@Test public void create_not_citizen() throws Exception { Account tourist = savedAccountTourist("tourist1"); try { service.create(tourist, "myapp", "ya ~ good", "http: fail("AccessDeniedException expected"); } catch (AccessDeniedException expected) { } }
@Override public ClientApp create(Authorization creator, String name, String description, String callbackUri) throws ClientAppMaxException { Account account = verifyDeveloper(creator); if (listClientApps(account).size() >= ClientApp.MAX_NO_OF_APPS) { throw new ClientAppMaxException(ClientApp.MAX_NO_OF_APPS); } return clientAppDao.createApp(account, name, description, callbackUri, Instant.now()); }
ClientAppServiceImpl implements ClientAppService { @Override public ClientApp create(Authorization creator, String name, String description, String callbackUri) throws ClientAppMaxException { Account account = verifyDeveloper(creator); if (listClientApps(account).size() >= ClientApp.MAX_NO_OF_APPS) { throw new ClientAppMaxException(ClientApp.MAX_NO_OF_APPS); } return clientAppDao.createApp(account, name, description, callbackUri, Instant.now()); } }
ClientAppServiceImpl implements ClientAppService { @Override public ClientApp create(Authorization creator, String name, String description, String callbackUri) throws ClientAppMaxException { Account account = verifyDeveloper(creator); if (listClientApps(account).size() >= ClientApp.MAX_NO_OF_APPS) { throw new ClientAppMaxException(ClientApp.MAX_NO_OF_APPS); } return clientAppDao.createApp(account, name, description, callbackUri, Instant.now()); }  }
ClientAppServiceImpl implements ClientAppService { @Override public ClientApp create(Authorization creator, String name, String description, String callbackUri) throws ClientAppMaxException { Account account = verifyDeveloper(creator); if (listClientApps(account).size() >= ClientApp.MAX_NO_OF_APPS) { throw new ClientAppMaxException(ClientApp.MAX_NO_OF_APPS); } return clientAppDao.createApp(account, name, description, callbackUri, Instant.now()); }  @Override ClientApp create(Authorization creator,
      String name,
      String description,
      String callbackUri); @Override ClientApp loadClientAppWithoutCache(String clientId); @Override List<ClientApp> listClientApps(Authorization creator); @Override void update(Authorization creator,
      String clientId,
      String name,
      String description,
      String callbackUri); @Override Optional<ClientApp> verifyRedirectUri(String clientId, String redirectUri); @Override String directGrantCode(String oauthDirectAuthorize,
      String clientId,
      String scope,
      String redirectUri); @Override OauthAccessTokenDto createOauthAccessTokenByGrantCode(String code,
      String clientId,
      String redirectUri); @Override Optional<ClientAppUserAccessToken> verifyAccessToken(@Nullable String rawAccessToken); @Override List<ClientAppUser> listGrantedAppUsers(Authorization authorization); @Override void resetClientAppSecret(Authorization creator, String clientId); @Override void revokeApp(Authorization user, String clientId); @Override boolean validateApp(String clientId, String clientSecret); @Override String generateDebugAccessToken(Authorization creator, String clientId); @Override List<ClientApp> listGrantedApps(Authorization user); }
ClientAppServiceImpl implements ClientAppService { @Override public ClientApp create(Authorization creator, String name, String description, String callbackUri) throws ClientAppMaxException { Account account = verifyDeveloper(creator); if (listClientApps(account).size() >= ClientApp.MAX_NO_OF_APPS) { throw new ClientAppMaxException(ClientApp.MAX_NO_OF_APPS); } return clientAppDao.createApp(account, name, description, callbackUri, Instant.now()); }  @Override ClientApp create(Authorization creator,
      String name,
      String description,
      String callbackUri); @Override ClientApp loadClientAppWithoutCache(String clientId); @Override List<ClientApp> listClientApps(Authorization creator); @Override void update(Authorization creator,
      String clientId,
      String name,
      String description,
      String callbackUri); @Override Optional<ClientApp> verifyRedirectUri(String clientId, String redirectUri); @Override String directGrantCode(String oauthDirectAuthorize,
      String clientId,
      String scope,
      String redirectUri); @Override OauthAccessTokenDto createOauthAccessTokenByGrantCode(String code,
      String clientId,
      String redirectUri); @Override Optional<ClientAppUserAccessToken> verifyAccessToken(@Nullable String rawAccessToken); @Override List<ClientAppUser> listGrantedAppUsers(Authorization authorization); @Override void resetClientAppSecret(Authorization creator, String clientId); @Override void revokeApp(Authorization user, String clientId); @Override boolean validateApp(String clientId, String clientSecret); @Override String generateDebugAccessToken(Authorization creator, String clientId); @Override List<ClientApp> listGrantedApps(Authorization user);  }