DefaultInterfaceConfigBuilder extends ConfigBuilder implements InterfaceConfigBuilder { public ParamConfigBuilder startMethodsExtraParamConfig() { Iterator<MethodConfigBuilder> methodConfigBuilders = methodBuilders.values().iterator(); ParamConfigBuilder[] builders = new ParamConfigBuilder[methodBuilders.size()]; int i = 0; while(methodConfigBuilders.hasNext()){ builders[i++] = methodConfigBuilders.next().startExtraParamConfig(); } return new CompositeParamConfigBuilder(builders); } DefaultInterfaceConfigBuilder(Class interfaze, CRestConfig crestConfig, ComponentRegistry<String,Deserializer> mimeDeserializerRegistry, ComponentRegistry<Class<?>, Serializer> classSerializerRegistry); InterfaceConfig build(); MethodConfigBuilder startMethodConfig(Method meth); InterfaceConfigBuilder setMethodsCharset(Charset charset); InterfaceConfigBuilder setMethodsSocketTimeout(int socketTimeout); InterfaceConfigBuilder setMethodsConnectionTimeout(int connectionTimeout); InterfaceConfigBuilder setMethodsRequestInterceptor(Class<? extends RequestInterceptor> requestInterceptorClass); InterfaceConfigBuilder setMethodsResponseHandler(Class<? extends ResponseHandler> responseHandlerClass); InterfaceConfigBuilder setMethodsErrorHandler(Class<? extends ErrorHandler> errorHandlerClass); InterfaceConfigBuilder setMethodsRetryHandler(Class<? extends RetryHandler> retryHandlerClass); InterfaceConfigBuilder setMethodsEntityWriter(Class<? extends EntityWriter> entityWriterClass); InterfaceConfigBuilder setMethodsConsumes(String... mimeTypes); InterfaceConfigBuilder setMethodsDeserializer(Class<? extends Deserializer> deserializerClass); InterfaceConfigBuilder setMethodsProduces(String contentType); InterfaceConfigBuilder setMethodsType(MethodType meth); InterfaceConfigBuilder appendMethodsPath(String path); InterfaceConfigBuilder setMethodsEndPoint(String endPoint); ParamConfigBuilder startMethodsExtraParamConfig(); InterfaceConfigBuilder setParamsSerializer(Class<? extends Serializer> paramSerializerClass); InterfaceConfigBuilder setParamsEncoded(boolean encoded); InterfaceConfigBuilder setParamsListSeparator(String separator); @Override String toString();  }
@Test public void startMethodsExtraParamConfigShouldReturnACompositeParamConfigBuilderOverAllMethodConfigExtraParamConfigBuilders() throws Exception { ParamConfigBuilder mockParamConfigBuilderM1 = mock(ParamConfigBuilder.class); ParamConfigBuilder mockParamConfigBuilderM2 = mock(ParamConfigBuilder.class); ParamConfigBuilder[] expectedBuilders = {mockParamConfigBuilderM1,mockParamConfigBuilderM2}; when(mockM1MethodConfigBuilder.startExtraParamConfig()).thenReturn(mockParamConfigBuilderM1); when(mockM2MethodConfigBuilder.startExtraParamConfig()).thenReturn(mockParamConfigBuilderM2); ParamConfigBuilder actual = toTest.startMethodsExtraParamConfig(); assertEquals(DefaultInterfaceConfigBuilder.CompositeParamConfigBuilder.class, actual.getClass()); assertArrayEquals(expectedBuilders, Classes.<ParamConfigBuilder[]>getFieldValue(actual, "builders")); }