From 9744bd973f27335b9d75427fa4529a06e8eefcfb Mon Sep 17 00:00:00 2001 From: LeoMoulin Date: Mon, 18 Mar 2024 14:29:30 +0100 Subject: [PATCH] Resolve conflicts and adapt tests --- .../java/ovh/herisson/Clyde/Endpoints/UserControllerTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/test/java/ovh/herisson/Clyde/Endpoints/UserControllerTest.java b/backend/src/test/java/ovh/herisson/Clyde/Endpoints/UserControllerTest.java index 9954a41..e0b6736 100644 --- a/backend/src/test/java/ovh/herisson/Clyde/Endpoints/UserControllerTest.java +++ b/backend/src/test/java/ovh/herisson/Clyde/Endpoints/UserControllerTest.java @@ -117,7 +117,7 @@ public class UserControllerTest { @Test public void userPatchTest(){ - User herobrine = new User("brine","hero","herobrine@admin.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Student,"test"); + User herobrine = new User("brine","hero","herobrine@admin.com","in your WalLs","ShadowsLand",new Date(0), null,Role.Admin,"test"); userRepository.save(herobrine); Token t = new Token(herobrine, tokenService.generateNewToken(), new Date()); @@ -127,7 +127,7 @@ public class UserControllerTest { data.put("firstName", "test"); //Teste que le patch s'execute bien - with().body(data).contentType(ContentType.JSON).header("Authorization", t.getToken()).when().request("PATCH", "/user").then().statusCode(200); + with().body(data).contentType(ContentType.JSON).header("Authorization", t.getToken()).pathParam("id", herobrine.getRegNo()).when().request("PATCH", "/user/{id}").then().statusCode(200); //Teste que la donnée a bien été altérée with().header("Authorization", t.getToken()).when().request("GET", "/user").then().body("firstName",equalTo("test"));