PMT-15: Implement Tests for Responses
All checks were successful
Quality Check / Validate OAS (push) Successful in 48s
Quality Check / Validate OAS (pull_request) Successful in 1m6s
Quality Check / Linting (push) Successful in 2m4s
Quality Check / Linting (pull_request) Successful in 2m7s
Quality Check / Testing (push) Successful in 2m12s
Quality Check / Static Analysis (push) Successful in 2m22s
Quality Check / Testing (pull_request) Successful in 2m12s
Quality Check / Static Analysis (pull_request) Successful in 2m16s
All checks were successful
Quality Check / Validate OAS (push) Successful in 48s
Quality Check / Validate OAS (pull_request) Successful in 1m6s
Quality Check / Linting (push) Successful in 2m4s
Quality Check / Linting (pull_request) Successful in 2m7s
Quality Check / Testing (push) Successful in 2m12s
Quality Check / Static Analysis (push) Successful in 2m22s
Quality Check / Testing (pull_request) Successful in 2m12s
Quality Check / Static Analysis (pull_request) Successful in 2m16s
This commit is contained in:
parent
d725addef8
commit
2cf79e3568
1 changed files with 31 additions and 0 deletions
31
src/test/java/de/hmmh/pmt/project/DeleteTest.java
Normal file
31
src/test/java/de/hmmh/pmt/project/DeleteTest.java
Normal 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())
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue