ApiClassAnnotationConfig { public void setAuthLevelIfSpecified(AuthLevel authLevel) { if (authLevel != AuthLevel.UNSPECIFIED) { config.setAuthLevel(authLevel); } } ApiClassAnnotationConfig(ApiClassConfig config); void setResourceIfNotEmpty(String resource); 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 setUseDatastoreIfSpecified(AnnotationBoolean useDatastore); void setApiKeyRequiredIfSpecified(AnnotationBoolean apiKeyRequired);  }
@Test public void testSetAuthLevelIfSpecified() throws Exception { for (AuthLevel authLevel : AuthLevel.values()) { if (authLevel == AuthLevel.UNSPECIFIED) { continue; } annotationConfig.setAuthLevelIfSpecified(authLevel); Mockito.verify(config).setAuthLevel(authLevel); } }
@Test public void testSetAuthLevelIfSpecified_unspecified() throws Exception { annotationConfig.setAuthLevelIfSpecified(AuthLevel.UNSPECIFIED); Mockito.verifyZeroInteractions(config); }