### Question:
HealthController { @GetMapping("") public void home(HttpServletResponse response) throws IOException { String siteUrl = appProperties.getSiteUrl(); if (StringUtils.isEmpty(siteUrl)) { response.sendError( HttpStatus.NOT_FOUND.value(), HttpStatus.NOT_FOUND.getReasonPhrase()); return; } response.sendRedirect(siteUrl); }  @GetMapping("") void home(HttpServletResponse response); @GetMapping("health") @ResponseBody String health();  }### Answer:
@Test @SneakyThrows @SuppressWarnings("ResultOfMethodCallIgnored") public void homeTest() { when(appProperties.getSiteUrl()).thenReturn("https: mvc.perform(MockMvcRequestBuilders.get("/")) .andExpect(status().is3xxRedirection()) .andExpect(redirectedUrl("https: verify(appProperties).getSiteUrl(); }