ListRepositoriesController { protected String createListUrl(final RepositoryName repositoryName, final boolean redirect) { return (redirect ? "redirect:" : "") + "/repos/" + encode(repositoryName.toString()) + "/list/"; } @Autowired  ListRepositoriesController(final Application application); @RequestMapping(params = "logout=true") String logoutBeforeListRepositories(@RequestParam final boolean logout, @RequestParam final String repositoryName,
                                             @ModelAttribute final UserContext userContext, final Model model); @RequestMapping(method = RequestMethod.GET) String listRepositoriesOrShowIfOnlyOne(final Model model);  }
@Test public void testCreateListUrl() { final ListRepositoriesController ctrl = new ListRepositoriesController(application); assertEquals("/repos/test/list/", ctrl.createListUrl(new RepositoryName("test"), false)); assertEquals("redirect:/repos/%C3%BC/list/", ctrl.createListUrl(new RepositoryName("\u00fc"), true)); }