push for docker
continuous-integration/drone/push Build is failing Details

Api_Game_Endpoints
David D'ALMEIDA 2 years ago
parent 563dfe98d5
commit 1573c81cd4

@ -45,6 +45,17 @@
<groupId>io.rest-assured</groupId> <groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId> <artifactId>rest-assured</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency>
<!-- Mockito dependencies -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency> </dependency>
<!-- Hibernate Reactive dependency --> <!-- Hibernate Reactive dependency -->
<dependency> <dependency>

@ -51,6 +51,9 @@
-- (4, 2, 3, 7); -- (4, 2, 3, 7);
INSERT INTO users (name, password) VALUES ('Alice', 'password123'); INSERT INTO users (name, password) VALUES ('Alice', 'password123');
INSERT INTO users (Id, name, Password) VALUES
(2, 'Bob', 'password2'),
(3, 'Charlie', 'password3');
INSERT INTO games (isFinished, nbPoints, time, winner, host_id) VALUES (false, 0, CURRENT_TIMESTAMP, 0, 1); INSERT INTO games (isFinished, nbPoints, time, winner, host_id) VALUES (false, 0, CURRENT_TIMESTAMP, 0, 1);
INSERT INTO participe (idGame, position, guestname, totalpoints, iduser) VALUES (1, 1, 'Alice', 0, 1); INSERT INTO participe (idGame, position, guestname, totalpoints, iduser) VALUES (1, 1, 'Alice', 0, 1);
INSERT INTO round (game_id, idGame, position, turnNumber, points) VALUES (1, 1, 1, 1, 0); INSERT INTO round (game_id, idGame, position, turnNumber, points) VALUES (1, 1, 1, 1, 0);

@ -1,7 +1,11 @@
package org.acme; package org.acme;
import io.quarkus.test.junit.QuarkusTest; import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import static io.restassured.RestAssured.given; import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.is;
@ -9,12 +13,27 @@ import static org.hamcrest.CoreMatchers.is;
@QuarkusTest @QuarkusTest
public class UserControllerTest { public class UserControllerTest {
@Test // @Test
public void testUserEndpoint() { // public void testUserEndpoint() {
given() // given()
.when().get("/users/1") // .when().get("/users/1")
.then() // .then()
.statusCode(200); // .statusCode(200);
} // }
// @Test
// @DisplayName("Test GET /users/{id}")
// @ParameterizedTest(name = "Test with user ID {0}")
// @CsvSource({
// "2, Bob",
// "3, Charlie"
// })
// public void testGetUserById(Long id, String expectedName) {
// given()
// .when().get("/users/{id}", id)
// .then()
// .statusCode(200)
// .body("name", equalTo(expectedName));
// }
} }
Loading…
Cancel
Save