diff --git a/src/test/java/de/hmmh/pmt/project/DeleteTest.java b/src/test/java/de/hmmh/pmt/project/DeleteTest.java new file mode 100644 index 0000000..21a8eb3 --- /dev/null +++ b/src/test/java/de/hmmh/pmt/project/DeleteTest.java @@ -0,0 +1,30 @@ +package de.hmmh.pmt.project; + +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import java.util.List; + +import org.junit.jupiter.api.Test; + +import de.hmmh.pmt.IntegrationTest; +import de.hmmh.pmt.db.Project; + +public class DeleteTest extends IntegrationTest { + @Test + void projectNotFound() throws Exception { + mvc + .perform(delete(baseUri + "/project/1")) + .andExpect(status().isNotFound()) + ; + } + + @Test + void deletedSuccessfully() throws Exception { + List allProjects = createTestProjectData(); + mvc + .perform(delete(baseUri + "/project/" + allProjects.get(1).getId())) + .andExpect(status().isNoContent()) + ; + } +}