class APIController {

    @GetMapping(value = "/public")
    public Message publicEndpoint() {
        return new Message("All good. You DO NOT need to be authenticated to call /api/public.");
    }

}

class APIControllerTest {

    @Autowired
    private MockMvc mockMvc;
    @MockBean
    @SuppressWarnings("unused")
    private JwtDecoder jwtDecoder;

    @Test
    public void testPublicEndpoint() throws Exception {

        MvcResult mvcResult = mockMvc.perform(get("/api/public"))
                .andDo(print())
                .andExpect(status().isOk())
                .andReturn();
        
        assertNotNull(mvcResult.getResponse().getContentAsString());
    }

}