Remove the custom AbstractWebIntegrationTests as they prevent Boot's default configuration from kicking in and it also fails to set up MockMvc to work with @WithMockUser properly.
hasRole(…) doesn't need any ROLE_ prefixes.
Suggested steps:
Switch to @SpringBootTest and @AutoConfigureWebMvc
Switch to @WithMockUser for security related interactions
Some useful tips from @rwinch:
AbstractWebIntegrationTests
as they prevent Boot's default configuration from kicking in and it also fails to set upMockMvc
to work with@WithMockUser
properly.hasRole(…)
doesn't need anyROLE_
prefixes.Suggested steps:
@SpringBootTest
and@AutoConfigureWebMvc
@WithMockUser
for security related interactions