Improve handling of missing parameters, now returns HTTP/401 (#698)
This commit is contained in:
committed by
René Zubcevic
parent
f7b794bf68
commit
ddf6ac9bdb
@ -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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user