@Test public void clientAppPart() throws Exception { Account account = accountTourist("foo"); String token = prepareAccessToken(account); when(accountService.findMe(isA(Authorization.class))).thenReturn(Optional.of(account)); ClientApp app1 = clientApp(account, "app1"); ClientApp app2 = clientApp(account, "app2"); when(clientAppService.listClientApps(isA(Authorization.class))).thenReturn(asList(app1, app2)); mockMvc.perform(get("/developer/client-app.part").header(AccountAccessToken.HEADER_KEY, token)) .andExpect(view().name("developer/client-app.part")) .andExpect(containsText("app1")) .andExpect(containsText("app2")); }
@RequestMapping("/client-app.part") public ModelAndView clientAppPart(AccountAccessToken accountAccessToken) { return new ModelAndView("developer/client-app.part").addObject("clientApps", clientAppService.listClientApps(accountAccessToken)) .addObject("allCanonicalScopes", ClientAppScope.allCanonicalScopes()); }
DeveloperController { @RequestMapping("/client-app.part") public ModelAndView clientAppPart(AccountAccessToken accountAccessToken) { return new ModelAndView("developer/client-app.part").addObject("clientApps", clientAppService.listClientApps(accountAccessToken)) .addObject("allCanonicalScopes", ClientAppScope.allCanonicalScopes()); } }
DeveloperController { @RequestMapping("/client-app.part") public ModelAndView clientAppPart(AccountAccessToken accountAccessToken) { return new ModelAndView("developer/client-app.part").addObject("clientApps", clientAppService.listClientApps(accountAccessToken)) .addObject("allCanonicalScopes", ClientAppScope.allCanonicalScopes()); }  }
DeveloperController { @RequestMapping("/client-app.part") public ModelAndView clientAppPart(AccountAccessToken accountAccessToken) { return new ModelAndView("developer/client-app.part").addObject("clientApps", clientAppService.listClientApps(accountAccessToken)) .addObject("allCanonicalScopes", ClientAppScope.allCanonicalScopes()); }  @RequestMapping("/client-app") String clientApp(); @RequestMapping("/client-app.part") ModelAndView clientAppPart(AccountAccessToken accountAccessToken); @RequestMapping("/doc") String doc(); @RequestMapping("") RedirectView root(); }
DeveloperController { @RequestMapping("/client-app.part") public ModelAndView clientAppPart(AccountAccessToken accountAccessToken) { return new ModelAndView("developer/client-app.part").addObject("clientApps", clientAppService.listClientApps(accountAccessToken)) .addObject("allCanonicalScopes", ClientAppScope.allCanonicalScopes()); }  @RequestMapping("/client-app") String clientApp(); @RequestMapping("/client-app.part") ModelAndView clientAppPart(AccountAccessToken accountAccessToken); @RequestMapping("/doc") String doc(); @RequestMapping("") RedirectView root();  }