PMT-15: Implement Tests for Responses
Some checks failed
Quality Check / Validate OAS (pull_request) Successful in 33s
Quality Check / Testing (pull_request) Failing after 55s
Quality Check / Linting (pull_request) Failing after 1m0s
Quality Check / Static Analysis (pull_request) Failing after 1m3s
Quality Check / Validate OAS (push) Successful in 32s
Quality Check / Testing (push) Failing after 52s
Quality Check / Linting (push) Failing after 58s
Quality Check / Static Analysis (push) Failing after 1m1s
Some checks failed
Quality Check / Validate OAS (pull_request) Successful in 33s
Quality Check / Testing (pull_request) Failing after 55s
Quality Check / Linting (pull_request) Failing after 1m0s
Quality Check / Static Analysis (pull_request) Failing after 1m3s
Quality Check / Validate OAS (push) Successful in 32s
Quality Check / Testing (push) Failing after 52s
Quality Check / Linting (push) Failing after 58s
Quality Check / Static Analysis (push) Failing after 1m1s
This commit is contained in:
parent
d725addef8
commit
d517d304ec
1 changed files with 30 additions and 0 deletions
30
src/test/java/de/hmmh/pmt/project/DeleteTest.java
Normal file
30
src/test/java/de/hmmh/pmt/project/DeleteTest.java
Normal 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())
|
||||
;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue