With Spring Boot 2.7.5, the following code works:

@RestController
public class SomeController {

    @GetMapping("/health")
    public Object foo() {
        return Map.of("foo", "bar");
    }
}
@WebMvcTest(SomeController.class)
public class SomeControllerTest {

    @Autowired
    private MockMvc mockMvc;

    @Test
    void health() throws Exception {
        mockMvc.perform(get("/health/"))
                .andExpect(status().isOk());
    }
}

After upgrading to 3.0.0-RC1, it fails with 404. Is this expected? Should I replace the URL in the Controller to include a slash or should I remove the slash from the test?

Comment From: scottfrederick

This change is covered in the 3.0.0-M4 release notes, including instructions for re-instating the previous default behavior.

Comment From: Thihup

Thank you! @scottfrederick