ApiClassConfig { public MethodConfigMap getMethods() { return methods; } ApiClassConfig(ApiConfig apiConfig, TypeLoader typeLoader, Class<?> apiClass);  ApiClassConfig(ApiClassConfig original, ApiConfig apiConfig); @Override boolean equals(Object o); @Override int hashCode(); ApiConfig getApiConfig(); String getApiClassJavaName(); String getApiClassJavaSimpleName(); void setResource(String resource); String getResource(); void setAuthLevel(AuthLevel authLevel); AuthLevel getAuthLevel(); void setScopeExpression(AuthScopeExpression scopeExpression); AuthScopeExpression getScopeExpression(); void setAudiences(List<String> audiences); List<String> getAudiences(); void setIssuerAudiences(ApiIssuerAudienceConfig issuerAudiences); ApiIssuerAudienceConfig getIssuerAudiences(); void setClientIds(List<String> clientIds); List<String> getClientIds(); void setAuthenticators(List<Class<? extends Authenticator>> authenticators); List<Class<? extends Authenticator>> getAuthenticators(); void setPeerAuthenticators(List<Class<? extends PeerAuthenticator>> peerAuthenticators); List<Class<? extends PeerAuthenticator>> getPeerAuthenticators(); void setUseDatastore(boolean useDatastore); boolean getUseDatastore(); MethodConfigMap getMethods(); void setApiKeyRequired(boolean apiKeyRequired); boolean isApiKeyRequired();  }
@Test public void testAddMethod() throws Exception { assertEquals(0, config.getMethods().size()); EndpointMethod method = getResultNoParamsMethod(); ApiMethodConfig methodConfig = config.getMethods().getOrCreate(method); Map<EndpointMethod, ApiMethodConfig> methodConfigs = config.getMethods(); assertEquals(1, methodConfigs.size()); assertEquals(methodConfig, methodConfigs.get(method)); }
@Test public void testAddMethodDuplicates() throws Exception { assertEquals(0, config.getMethods().size()); EndpointMethod method1 = getGetDateMethod(); ApiMethodConfig methodConfig1 = config.getMethods().getOrCreate(method1); ApiMethodConfig methodConfig2 = config.getMethods().getOrCreate(method1); assertEquals(1, config.getMethods().size()); assertEquals(methodConfig1, methodConfig2); EndpointMethod method2 = getResultNoParamsMethod(); methodConfig1 = config.getMethods().getOrCreate(method2); methodConfig2 = config.getMethods().getOrCreate(method2); assertEquals(2, config.getMethods().size()); assertEquals(methodConfig1, methodConfig2); }