Skip to content
Snippets Groups Projects
Commit a1200f76 authored by xkromm's avatar xkromm
Browse files

updated employee controller tests

parent 10220d53
No related branches found
No related tags found
1 merge request!12Controller tests
......@@ -11,7 +11,6 @@ import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.ApplicationContext;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
......@@ -27,9 +26,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@WebMvcTest(controllers = {EmployeeController.class})
class EmployeeControllerTest {
@Autowired
private ApplicationContext applicationContext;
@Autowired
private MockMvc mockMvc;
......@@ -92,7 +88,7 @@ class EmployeeControllerTest {
mockMvc.perform(put("/employee/{id}", id)
.contentType(MediaType.APPLICATION_JSON)
.content("{\"id\":\"" + id.toString() + "\",\"name\":\"UpdatedName\",\"surname\":\"UpdatedSurname\",\"gender\":false,\"dateOfBirth\":\"1990-01-01\",\"hired\":\"2015-01-01\",\"terminated\":\"2022-01-01\"}"))
.content("{\"id\":\"" + id + "\",\"name\":\"UpdatedName\",\"surname\":\"UpdatedSurname\",\"gender\":false,\"dateOfBirth\":\"1990-01-01\",\"hired\":\"2015-01-01\",\"terminated\":\"2022-01-01\"}"))
.andExpect(status().isNotFound());
Mockito.verify(employeeFacade, Mockito.times(1)).updateEmployee(Mockito.eq(id), Mockito.any(EmployeeRequest.class));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment