generated from Arquisoft/wiq_0
-
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.
- Loading branch information
Showing
4 changed files
with
17 additions
and
18 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,9 +74,10 @@ public class Wiq_UnitTests { | |
|
||
private final HttpClient httpClient = HttpClient.newHttpClient(); | ||
|
||
private Player createPlayer(){ | ||
return new Player("name","[email protected]","password"); | ||
private Player createPlayer() { | ||
return new Player("name", "[email protected]", "password"); | ||
} | ||
|
||
private Player createDiferentPlayer(String word){ | ||
return new Player("name"+word,word+"[email protected]","password"); | ||
} | ||
|
@@ -789,7 +790,7 @@ public void testGetQuestionsInvalidApiKey() throws IOException, InterruptedExcep | |
@Test | ||
@Order(50) | ||
public void testGetQuestions() throws IOException, InterruptedException, JSONException { | ||
insertSomeQuestions(); | ||
insertSomeQuestions();; | ||
Player player = playerService.getUsersByRole("ROLE_USER").get(0); | ||
ApiKey apiKey = player.getApiKey(); | ||
|
||
|
@@ -840,7 +841,7 @@ public void testGetQuestionsByCategoryId() throws IOException, InterruptedExcept | |
@Test | ||
@Order(53) | ||
public void testGetQuestionById() throws IOException, InterruptedException, JSONException { | ||
insertSomeQuestions(); | ||
insertSomeQuestions();; | ||
Player player = playerService.getUsersByRole("ROLE_USER").get(0); | ||
ApiKey apiKey = player.getApiKey(); | ||
Question question = questionService.getAllQuestions().get(0); | ||
|
@@ -1325,7 +1326,7 @@ public void testAddQuestionMultipleCorrect() throws IOException, InterruptedExce | |
@Test | ||
@Order(88) | ||
public void testModifyQuestionInvalidApiKey() throws IOException, InterruptedException, JSONException { | ||
insertSomeQuestions(); | ||
insertSomeQuestions();; | ||
Question question = questionService.getAllQuestions().get(0); | ||
|
||
HttpResponse<String> response = sendRequest("PATCH", "/api/questions/" + question.getId(), Map.of("API-KEY", "zzzz"), | ||
|
@@ -1349,7 +1350,7 @@ public void testModifyQuestionNotFound() throws IOException, InterruptedExceptio | |
@Test | ||
@Order(90) | ||
public void testModifyQuestionMissingData() throws IOException, InterruptedException, JSONException { | ||
insertSomeQuestions(); | ||
insertSomeQuestions();; | ||
Question question = questionService.getAllQuestions().get(0); | ||
Player player = playerService.getUsersByRole("ROLE_USER").get(0); | ||
ApiKey apiKey = player.getApiKey(); | ||
|
@@ -1364,7 +1365,7 @@ public void testModifyQuestionMissingData() throws IOException, InterruptedExcep | |
@Order(91) | ||
@Tag("flaky") | ||
public void testModifyQuestion() throws IOException, InterruptedException, JSONException { | ||
insertSomeQuestions(); | ||
insertSomeQuestions();; | ||
Question question = questionService.getAllQuestions().get(0); | ||
Player player = playerService.getUsersByRole("ROLE_USER").get(0); | ||
ApiKey apiKey = player.getApiKey(); | ||
|
@@ -1398,7 +1399,7 @@ public void testModifyQuestion() throws IOException, InterruptedException, JSONE | |
@Test | ||
@Order(92) | ||
public void testModifyQuestionWithLessOptions() throws IOException, InterruptedException, JSONException { | ||
insertSomeQuestions(); | ||
insertSomeQuestions();; | ||
Question question = questionService.getAllQuestions().get(0); | ||
Player player = playerService.getUsersByRole("ROLE_USER").get(0); | ||
ApiKey apiKey = player.getApiKey(); | ||
|
@@ -1424,7 +1425,7 @@ public void testModifyQuestionWithLessOptions() throws IOException, InterruptedE | |
@Test | ||
@Order(93) | ||
public void testModifyQuestionWithNoCorrect() throws IOException, InterruptedException, JSONException { | ||
insertSomeQuestions(); | ||
insertSomeQuestions();; | ||
Question question = questionService.getAllQuestions().get(0); | ||
Player player = playerService.getUsersByRole("ROLE_USER").get(0); | ||
ApiKey apiKey = player.getApiKey(); | ||
|
@@ -1452,7 +1453,7 @@ public void testModifyQuestionWithNoCorrect() throws IOException, InterruptedExc | |
@Test | ||
@Order(94) | ||
public void testDeleteQuestionInvalidApiKey() throws IOException, InterruptedException, JSONException { | ||
insertSomeQuestions(); | ||
insertSomeQuestions();; | ||
Question question = questionService.getAllQuestions().get(0); | ||
|
||
HttpResponse<String> response = sendRequest("DELETE", "/api/questions/" + question.getId(), Map.of("API-KEY", "zzzz"), | ||
|
@@ -1477,7 +1478,7 @@ public void testDeleteQuestionNotFound() throws IOException, InterruptedExceptio | |
@Order(96) | ||
@Tag("flaky") | ||
public void testDeleteQuestion() throws IOException, InterruptedException, JSONException { | ||
insertSomeQuestions(); | ||
insertSomeQuestions();; | ||
Question question = questionService.getAllQuestions().get(0); | ||
Player player = playerService.getUsersByRole("ROLE_USER").get(0); | ||
ApiKey apiKey = player.getApiKey(); | ||
|
@@ -1633,8 +1634,7 @@ public void testScoreMultiplayerCodeAssignment() { | |
@Test | ||
@Order(106) | ||
public void GameSessionImpl_startNewMultiplayerGame() throws InterruptedException, IOException { | ||
sampleDataService.insertSampleQuestions(); | ||
sampleDataService.generateSampleData(); | ||
insertSomeQuestions(); | ||
|
||
Long playerId = 1L; | ||
Player player = createPlayer(); | ||
|
@@ -1653,8 +1653,7 @@ public void GameSessionImpl_startNewMultiplayerGame() throws InterruptedExcepti | |
@Test | ||
@Order(107) | ||
public void testRandomMultiplayerQuestions() throws InterruptedException, IOException { | ||
sampleDataService.insertSampleQuestions(); | ||
sampleDataService.generateSampleData(); | ||
insertSomeQuestions(); | ||
|
||
Long playerId = 1L; | ||
Player player = createPlayer(); | ||
|