This commit is contained in:
Nanne Baars
2019-09-20 17:36:15 +02:00
parent f29b923eef
commit c8ef848657
3 changed files with 25 additions and 21 deletions

View File

@ -88,13 +88,13 @@ public class HttpBasicsInterceptRequestTest extends AssignmentEndpointTest {
.andExpect(jsonPath("$.lessonCompleted", CoreMatchers.is(false)));
}
// @Test
// public void whenPostAssignmentShouldNotPass() throws Exception {
// mockMvc.perform(MockMvcRequestBuilders.post("/HttpProxies/intercept-request")
// .header("x-request-intercepted", "true")
// .param("changeMe", "Requests are tampered easily"))
// .andExpect(status().isOk())
// .andExpect(jsonPath("$.feedback", CoreMatchers.is(messages.getMessage("http-proxies.intercept.failure"))))
// .andExpect(jsonPath("$.lessonCompleted", CoreMatchers.is(false)));
// }
@Test
public void whenPostAssignmentShouldNotPass() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.post("/HttpProxies/intercept-request")
.header("x-request-intercepted", "true")
.param("changeMe", "Requests are tampered easily"))
.andExpect(status().isOk())
.andExpect(jsonPath("$.feedback", CoreMatchers.is(messages.getMessage("http-proxies.intercept.failure"))))
.andExpect(jsonPath("$.lessonCompleted", CoreMatchers.is(false)));
}
}