VersionController { @GetMapping(path = "version.png") public RedirectView versionPng() { return new RedirectView(String.format(PNG_URL_FORMAT, VERSION)); }  @GetMapping(path = "version.txt") String versionTxt(); @GetMapping(path = "version.svg") RedirectView versionSvg(); @GetMapping(path = "version.png") RedirectView versionPng();  }
@Test public void versionPng() throws Exception { mockMvc.perform(get(CONTEXT_PATH + "/version.png")).andExpect(status().is3xxRedirection()).andExpect( redirectedUrl(String.format(PNG_URL_FORMAT, VERSION))); }