forked from TEAMMATES/teammates
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from cliu585/test-search-service-active
Fixed further compiler errors resulting from the second pull request
- Loading branch information
Showing
1 changed file
with
4 additions
and
3 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 |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
import teammates.storage.sqlentity.AccountRequest; | ||
import teammates.test.AssertHelper; | ||
import teammates.test.TestProperties; | ||
import teammates.common.datatransfer.AccountRequestStatus; | ||
|
||
/** | ||
* SUT: {@link AccountRequestsDb}, | ||
|
@@ -171,13 +172,13 @@ public void testSqlInjectionSearchAccountRequestsInWholeSystem() throws Exceptio | |
} | ||
|
||
AccountRequest accountRequest = new AccountRequest("[email protected]", "name", "institute", AccountRequestStatus.PENDING, "comments"); | ||
accountRequestDb.createAccountRequest(accountRequest); | ||
accountRequestsDb.createAccountRequest(accountRequest); | ||
|
||
String searchInjection = "institute'; DROP TABLE account_requests; --"; | ||
List<AccountRequest> actualInjection = accountRequestsDb.searchAccountRequestsInWholeSystem(searchInjection); | ||
assertEquals(typicalBundle.accountRequests.size(), actualInjection.size()); | ||
assertEquals(typicalBundle.accountRequests, actualInjection.size()); | ||
|
||
AccountRequest actual = accountRequestsDb.getAccountRequest("[email protected]", "institute"); | ||
AccountRequest actual = accountRequestsDb.getAccountRequest(accountRequest.getId()); | ||
assertEquals(accountRequest, actual); | ||
} | ||
|
||
|