Created
June 6, 2018 12:40
-
-
Save sirius2k/1ee07c2ed3c15c3e915c0636e40a3f63 to your computer and use it in GitHub Desktop.
Usage of Hamcrest instanceOf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testLogin() throws Exception { | |
this.mockMvc.perform((post("/login").accept(MediaType.ALL).param("id", "admin").param("password", "admin").with(csrf()))) | |
.andDo(print()) | |
.andExpect(status().is3xxRedirection()) | |
.andExpect(request().sessionAttribute("SPRING_SECURITY_LAST_EXCEPTION", instanceOf(BadCredentialsException.class))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment