That code take me an error, i try with Spring Boot and Mockito, Junit4:
@Test
public void logout() throws Exception, ApiException {
//String result = "{\"date\":\"20190212:0000\"}";
//Mockito.when(controller.logout(any())).thenReturn(result);
mockMvc.perform(MockMvcRequestBuilders.post(REST_REQUEST_PATH)
.header("principal", "admin")
.header("authorization", "authtoken")
.contentType(MediaType.APPLICATION_JSON)
.accept("application/json"))
.andExpect(status().isOk())
.andDo(document("logout",
responseFields(fieldWithPath("date").description("Fecha de entrega de la respuesta.")
)));
}
Aucun commentaire:
Enregistrer un commentaire