From 418b15e7780a2096ac86269aa54acdda81a0808a Mon Sep 17 00:00:00 2001
From: Pelayori <31128562+Pelayori@users.noreply.github.com>
Date: Fri, 26 Apr 2024 23:26:54 +0200
Subject: [PATCH] Merge and fix footers
---
src/main/resources/templates/game/lobby.html | 2 +-
.../templates/game/multiplayerGame.html | 2 +-
.../templates/ranking/multiplayerRanking.html | 2 +-
src/test/java/com/uniovi/Wiq_UnitTests.java | 29 +++++++++----------
4 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/src/main/resources/templates/game/lobby.html b/src/main/resources/templates/game/lobby.html
index c3da3314..116de0f7 100644
--- a/src/main/resources/templates/game/lobby.html
+++ b/src/main/resources/templates/game/lobby.html
@@ -2,7 +2,7 @@
-
+
diff --git a/src/main/resources/templates/game/multiplayerGame.html b/src/main/resources/templates/game/multiplayerGame.html
index 81af9294..6b26fe71 100644
--- a/src/main/resources/templates/game/multiplayerGame.html
+++ b/src/main/resources/templates/game/multiplayerGame.html
@@ -1,7 +1,7 @@
-
+
diff --git a/src/main/resources/templates/ranking/multiplayerRanking.html b/src/main/resources/templates/ranking/multiplayerRanking.html
index 5fc16703..4da4cbf9 100644
--- a/src/main/resources/templates/ranking/multiplayerRanking.html
+++ b/src/main/resources/templates/ranking/multiplayerRanking.html
@@ -1,7 +1,7 @@
+
diff --git a/src/test/java/com/uniovi/Wiq_UnitTests.java b/src/test/java/com/uniovi/Wiq_UnitTests.java
index 9fce435d..da94c0a8 100644
--- a/src/test/java/com/uniovi/Wiq_UnitTests.java
+++ b/src/test/java/com/uniovi/Wiq_UnitTests.java
@@ -74,9 +74,10 @@ public class Wiq_UnitTests {
private final HttpClient httpClient = HttpClient.newHttpClient();
- private Player createPlayer(){
- return new Player("name","test@email.com","password");
+ private Player createPlayer() {
+ return new Player("name", "test@email.com", "password");
}
+
private Player createDiferentPlayer(String word){
return new Player("name"+word,word+"test@email.com","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 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 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();