From 4abce554e5ad4b96487d32f6076979a7c2449797 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Wed, 2 Oct 2024 11:17:09 +0200 Subject: [PATCH] test(DeleteProjectActionTest): update test project IDs for accuracy --- .../integration/project/DeleteProjectActionTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/test/java/de/szut/lf8_starter/integration/project/DeleteProjectActionTest.java b/src/test/java/de/szut/lf8_starter/integration/project/DeleteProjectActionTest.java index 1e006d9..070fbe9 100644 --- a/src/test/java/de/szut/lf8_starter/integration/project/DeleteProjectActionTest.java +++ b/src/test/java/de/szut/lf8_starter/integration/project/DeleteProjectActionTest.java @@ -11,10 +11,8 @@ import org.springframework.test.web.servlet.MockMvc; import java.time.LocalDate; import java.util.List; -import static org.hamcrest.collection.IsCollectionWithSize.hasSize; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest @@ -28,7 +26,7 @@ public class DeleteProjectActionTest { @Test void deleteProjectTest() throws Exception { var project = new ProjectEntity(); - project.setId(1); + project.setId(20); project.setComment("comment"); project.setContractor(1); project.setContractorName("contractorName"); @@ -39,12 +37,12 @@ public class DeleteProjectActionTest { project.setEmployees(List.of(1L, 2L, 3L)); this.projectRepository.save(project); - this.mockMvc.perform(delete("/projects/1")) + this.mockMvc.perform(delete("/projects/20")) .andExpect(status().isNoContent()); } @Test void deleteProjectShouldReturnNotFoundResponseWhenProjectIsNotFound() throws Exception { - this.mockMvc.perform(get("/projects/2")).andExpect(status().isNotFound()); + this.mockMvc.perform(get("/projects/2987")).andExpect(status().isNotFound()); } }