79677889

Date: 2025-06-24 16:10:07
Score: 0.5
Natty:
Report link

I encountered a similar error when doing this test scenario (which worked in spring boot 3.2.5 but not anymore in spring boot 3.5.2):

@SpringBootTest
@AutoConfigureMockMvc
class DefaultApiSecurityTest {
  @Autowired private WebApplicationContext context;

  private MockMvc mvc;

  @BeforeEach
  public void init() {
    this.mvc = MockMvcBuilders.webAppContextSetup(context).apply(springSecurity()).build();
  }

  @Test
  void accessToPublicRoutesAsAnonymousShouldBeGranted() throws Exception {
    this.mvc.perform(MockMvcRequestBuilders.get("/v3/api-docs")).andExpect(status().isOk());
  }
}

The solution was to follow https://stackoverflow.com/a/79322542/7059810, maybe the problem here was similar where the update ended up making the test scenario call a method which was now returning a 500 error.

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Jonathan Simonney