Improve handling of missing parameters, now returns HTTP/401 (#698)

This commit is contained in:
Nanne Baars
2019-11-03 18:27:03 +01:00
committed by René Zubcevic
parent f7b794bf68
commit ddf6ac9bdb
2 changed files with 40 additions and 9 deletions

View File

@ -195,4 +195,22 @@ public class JWTRefreshEndpointTest extends LessonTest {
.content(objectMapper.writeValueAsString(refreshJson)))
.andExpect(status().isUnauthorized());
}
@Test
public void noTokenWhileCheckoutShouldReturn401() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.post("/JWT/refresh/checkout"))
.andExpect(status().isUnauthorized());
}
@Test
public void noTokenWhileRequestingNewTokenShouldReturn401() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.post("/JWT/refresh/newToken"))
.andExpect(status().isUnauthorized());
}
@Test
public void noTokenWhileLoginShouldReturn401() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.post("/JWT/refresh/login"))
.andExpect(status().isUnauthorized());
}
}