PMT-15: Implement Tests for Responses
All checks were successful
Quality Check / Validate OAS (push) Successful in 33s
Quality Check / Linting (push) Successful in 1m8s
Quality Check / Testing (push) Successful in 1m9s
Quality Check / Static Analysis (push) Successful in 1m13s

This commit is contained in:
Ole Kück 2024-10-09 10:51:03 +02:00
parent 98b1e40dc9
commit cf62906161

View file

@ -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<Project> allProjects = createTestProjectData();
mvc
.perform(delete(baseUri + "/project/" + allProjects.get(1).getId()))
.andExpect(status().isNoContent())
;
}
}