test: add 404 response test for non-existent project
All checks were successful
Quality Check / Tests (pull_request) Successful in 1m8s
gitea-sonarqube-bot OK
Build PR / Build and analyze (pull_request) Successful in 1m46s
Quality Check / Checkstyle Main (pull_request) Successful in 35s

This commit is contained in:
Jan Gleytenhoover 2024-10-23 11:47:58 +02:00
parent 304a88ae0e
commit d702a867c7
Signed by: jank
GPG Key ID: B267751B8AE29EFE

@ -17,8 +17,7 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@SpringBootTest
@ -75,4 +74,12 @@ class RemoveEmployeeFromProjectIntegrationTest {
return Objects.requireNonNull(response.getBody()).get("access_token").toString();
}
@Test
void removeEmployeeShouldReturn404IfProjectNotFound() throws Exception {
mockMvc.perform(delete("/projects/{projectId}/employees/{employeeId}", 1987234987, 312)
.header(HttpHeaders.AUTHORIZATION, getBearerToken())
.contentType(MediaType.APPLICATION_JSON))
.andExpect(status().isNotFound());
}
}