PMT-15: Projekte löschen #11

Merged
SZUT-Ole merged 3 commits from story/PMT-15-projekte-loeschen into trunk 2024-10-09 13:14:40 +00:00
Showing only changes of commit 2cf79e3568 - Show all commits

View file

@ -0,0 +1,31 @@
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 java.util.Map;
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 {
Map<String,Project> allProjects = createTestProjectData();
mvc
.perform(delete(baseUri + "/project/" + allProjects.get("space-station").getId()))
.andExpect(status().isNoContent())
;
}
}