-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add isTransactionNeeded method to Action * Remove delay from taskqueuer * Change CreateAccountRequest to handle own transactions
- Loading branch information
1 parent
c4fe140
commit 356c318
Showing
8 changed files
with
97 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
package teammates.it.ui.webapi; | ||
|
||
import org.testng.annotations.BeforeMethod; | ||
import org.testng.annotations.Test; | ||
|
||
import teammates.common.util.Const; | ||
import teammates.common.util.EmailType; | ||
import teammates.common.util.EmailWrapper; | ||
import teammates.common.util.HibernateUtil; | ||
import teammates.storage.sqlentity.AccountRequest; | ||
import teammates.ui.output.JoinLinkData; | ||
import teammates.ui.request.AccountCreateRequest; | ||
|
@@ -26,6 +28,13 @@ String getRequestMethod() { | |
return POST; | ||
} | ||
|
||
@BeforeMethod | ||
@Override | ||
protected void setUp() { | ||
// CreateAccountRequestAction handles its own transactions; | ||
// There is thus no need to setup a transaction. | ||
} | ||
|
||
@Override | ||
@Test | ||
protected void testExecute() throws Exception { | ||
|
@@ -37,7 +46,9 @@ protected void testExecute() throws Exception { | |
CreateAccountRequestAction action = getAction(request); | ||
JsonResult result = getJsonResult(action); | ||
JoinLinkData output = (JoinLinkData) result.getOutput(); | ||
HibernateUtil.beginTransaction(); | ||
AccountRequest accountRequest = logic.getAccountRequest("[email protected]", "The Fellowship of the Ring"); | ||
HibernateUtil.commitTransaction(); | ||
assertEquals("[email protected]", accountRequest.getEmail()); | ||
assertEquals("Frodo Baggins", accountRequest.getName()); | ||
assertEquals("The Fellowship of the Ring", accountRequest.getInstitute()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters