ApiMethodAnnotationConfig { public void setClientIdsIfSpecified(String[] clientIds) { if (!AnnotationUtil.isUnspecified(clientIds)) { config.setClientIds(Arrays.asList(clientIds)); } } ApiMethodAnnotationConfig(ApiMethodConfig config); ApiMethodConfig getConfig(); void setNameIfNotEmpty(String name); void setDescriptionIfNotEmpty(String description); void setPathIfNotEmpty(String path); void setHttpMethodIfNotEmpty(String httpMethod); void setAuthLevelIfSpecified(AuthLevel authLevel); void setScopesIfSpecified(String[] scopes); void setAudiencesIfSpecified(String[] audiences); void setIssuerAudiencesIfSpecified(ApiIssuerAudienceConfig issuerAudiences); void setClientIdsIfSpecified(String[] clientIds); void setAuthenticatorsIfSpecified(Class<? extends Authenticator>[] authenticators); void setPeerAuthenticatorsIfSpecified(
      Class<? extends PeerAuthenticator>[] peerAuthenticators); void setIgnoredIfSpecified(AnnotationBoolean ignored); void setApiKeyRequiredIfSpecified(AnnotationBoolean apiKeyRequired); void setMetricCosts(ApiMetricCost[] metricCosts);  }
@Test public void testSetClientIdsIfSpecified() throws Exception { String[] clientIds = {"foo", "bar"}; annotationConfig.setClientIdsIfSpecified(clientIds); assertEquals(Arrays.asList(clientIds), config.getClientIds()); }
@Test public void testSetClientIdsIfSpecified_empty() throws Exception { String[] empty = {}; annotationConfig.setClientIdsIfSpecified(empty); assertEquals(Collections.emptyList(), config.getClientIds()); String[] clientIds = {"bleh", "more bleh"}; annotationConfig.setClientIdsIfSpecified(clientIds); annotationConfig.setClientIdsIfSpecified(empty); assertEquals(Collections.emptyList(), config.getClientIds()); }
@Test public void testSetClientIdsIfSpecified_unspecified() throws Exception { testDefaults(); annotationConfig.setClientIdsIfSpecified(null); testDefaults(); String[] unspecified = {Api.UNSPECIFIED_STRING_FOR_LIST}; annotationConfig.setClientIdsIfSpecified(unspecified); testDefaults(); String[] clientIds = {"bleh", "more bleh"}; annotationConfig.setClientIdsIfSpecified(clientIds); annotationConfig.setClientIdsIfSpecified(unspecified); assertEquals(Arrays.asList(clientIds), config.getClientIds()); }