In JUnit tests with Spring MockMVC, there are two methods for authenticating as a Spring Security user: @WithMockUser creates a dummy user with the provided credent
@WithMockUser
You can use @PostConstruct instead of @Before. That did the trick for me. Can anybody confirm that?
@PostConstruct
@Before