@Test public void testPublicEndpoint() throws Exception { MvcResult mvcResult = mockMvc.perform(get("/api/public")) .andDo(print()) .andExpect(status().isOk()) .andReturn(); assertNotNull(mvcResult.getResponse().getContentAsString()); }
@GetMapping(value = "/public") public Message publicEndpoint() { return new Message("All good. You DO NOT need to be authenticated to call /api/public."); }
APIController { @GetMapping(value = "/public") public Message publicEndpoint() { return new Message("All good. You DO NOT need to be authenticated to call /api/public."); } }
APIController { @GetMapping(value = "/public") public Message publicEndpoint() { return new Message("All good. You DO NOT need to be authenticated to call /api/public."); }  }
APIController { @GetMapping(value = "/public") public Message publicEndpoint() { return new Message("All good. You DO NOT need to be authenticated to call /api/public."); }  @GetMapping(value = "/public") Message publicEndpoint(); @GetMapping(value = "/private") Message privateEndpoint(); @GetMapping(value = "/private-scoped") Message privateScopedEndpoint(); }
APIController { @GetMapping(value = "/public") public Message publicEndpoint() { return new Message("All good. You DO NOT need to be authenticated to call /api/public."); }  @GetMapping(value = "/public") Message publicEndpoint(); @GetMapping(value = "/private") Message privateEndpoint(); @GetMapping(value = "/private-scoped") Message privateScopedEndpoint();  }