Skip to content

Commit

Permalink
Merge and fix footers
Browse files Browse the repository at this point in the history
  • Loading branch information
Pelayori committed Apr 26, 2024
1 parent 49b1911 commit 418b15e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/templates/game/lobby.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<head th:replace="~{fragments/head}"></head>
<body>
<body class="d-flex flex-column min-vh-100">
<link th:href="@{/css/multiplayer.css}" rel="stylesheet" type="text/css"/>
<canvas th:replace="~{fragments/background}"></canvas>
<nav th:replace="~{fragments/nav}"></nav>
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/game/multiplayerGame.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{fragments/head}"></head>
<body>
<body class="d-flex flex-column min-vh-100">
<link th:href="@{/css/multiplayer.css}" rel="stylesheet" type="text/css"/>
<canvas th:replace="~{fragments/background}"></canvas>
<nav th:replace="~{fragments/nav}"></nav>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://thymeleaf.org">
<head th:replace="~{fragments/head}"/>
<body>
<body class="d-flex flex-column min-vh-100">
<nav th:replace="~{fragments/nav}"/>

<canvas th:replace="~{fragments/background}"></canvas>
Expand Down
29 changes: 14 additions & 15 deletions src/test/java/com/uniovi/Wiq_UnitTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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"),
Expand All @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down Expand Up @@ -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"),
Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 418b15e

Please sign in to comment.