Skip to content

Commit

Permalink
Merge pull request #3 from cliu585/test-search-service-active
Browse files Browse the repository at this point in the history
Fixed further compiler errors resulting from the second pull request
  • Loading branch information
cliu585 authored Apr 28, 2024
2 parents 15d39fd + 0cbbdfc commit 823fa37
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 823fa37

Please sign in to comment.