@Test public void shouldOverrideValueForProduces() throws Exception { mockEndpoint(); mockOverride(MethodConfig.METHOD_CONFIG_DEFAULT_PRODUCES, "value"); DefaultMethodConfigBuilder toTest = newToTest(); MethodConfig actual = toTest.build(); assertCommons(actual); assertEquals("value",actual.getProduces()); }
public MethodConfig build() throws Exception { validate(); ParamConfig[] pConfigMethod = buildParams(methodParamConfigBuilders); ParamConfig[] pExtraParams = merge(ParamConfig.class, extraParams, buildParams(extraParamBuilders)); ParamConfig[] allParams = merge(ParamConfig.class, pConfigMethod, pExtraParams); return new DefaultMethodConfig( charset, method, RegexPathTemplate.create(buildPath()), produces, arrify(this.consumes, String.class), meth, socketTimeout, connectionTimeout, getEntityWriter(allParams), instantiate(requestInterceptor), instantiate(responseHandler), instantiate(errorHandler), instantiate(retryHandler), getDeserializers(), pConfigMethod, pExtraParams ); }
DefaultMethodConfigBuilder extends ConfigBuilder implements MethodConfigBuilder { public MethodConfig build() throws Exception { validate(); ParamConfig[] pConfigMethod = buildParams(methodParamConfigBuilders); ParamConfig[] pExtraParams = merge(ParamConfig.class, extraParams, buildParams(extraParamBuilders)); ParamConfig[] allParams = merge(ParamConfig.class, pConfigMethod, pExtraParams); return new DefaultMethodConfig( charset, method, RegexPathTemplate.create(buildPath()), produces, arrify(this.consumes, String.class), meth, socketTimeout, connectionTimeout, getEntityWriter(allParams), instantiate(requestInterceptor), instantiate(responseHandler), instantiate(errorHandler), instantiate(retryHandler), getDeserializers(), pConfigMethod, pExtraParams ); } }
DefaultMethodConfigBuilder extends ConfigBuilder implements MethodConfigBuilder { public MethodConfig build() throws Exception { validate(); ParamConfig[] pConfigMethod = buildParams(methodParamConfigBuilders); ParamConfig[] pExtraParams = merge(ParamConfig.class, extraParams, buildParams(extraParamBuilders)); ParamConfig[] allParams = merge(ParamConfig.class, pConfigMethod, pExtraParams); return new DefaultMethodConfig( charset, method, RegexPathTemplate.create(buildPath()), produces, arrify(this.consumes, String.class), meth, socketTimeout, connectionTimeout, getEntityWriter(allParams), instantiate(requestInterceptor), instantiate(responseHandler), instantiate(errorHandler), instantiate(retryHandler), getDeserializers(), pConfigMethod, pExtraParams ); } DefaultMethodConfigBuilder(InterfaceConfigBuilder parent, Method method, CRestConfig crestConfig, ComponentRegistry<String,Deserializer> mimeDeserializerRegistry, ComponentRegistry<Class<?>, Serializer> classSerializerRegistry); }
DefaultMethodConfigBuilder extends ConfigBuilder implements MethodConfigBuilder { public MethodConfig build() throws Exception { validate(); ParamConfig[] pConfigMethod = buildParams(methodParamConfigBuilders); ParamConfig[] pExtraParams = merge(ParamConfig.class, extraParams, buildParams(extraParamBuilders)); ParamConfig[] allParams = merge(ParamConfig.class, pConfigMethod, pExtraParams); return new DefaultMethodConfig( charset, method, RegexPathTemplate.create(buildPath()), produces, arrify(this.consumes, String.class), meth, socketTimeout, connectionTimeout, getEntityWriter(allParams), instantiate(requestInterceptor), instantiate(responseHandler), instantiate(errorHandler), instantiate(retryHandler), getDeserializers(), pConfigMethod, pExtraParams ); } DefaultMethodConfigBuilder(InterfaceConfigBuilder parent, Method method, CRestConfig crestConfig, ComponentRegistry<String,Deserializer> mimeDeserializerRegistry, ComponentRegistry<Class<?>, Serializer> classSerializerRegistry); MethodConfig build(); ParamConfigBuilder startParamConfig(int index); ParamConfigBuilder startExtraParamConfig(); MethodConfigBuilder setConsumes(String... mimeTypes); MethodConfigBuilder setCharset(Charset charset); MethodConfigBuilder setProduces(String contentType); MethodConfigBuilder appendPath(String path); MethodConfigBuilder setEndPoint(String endPoint); MethodConfigBuilder setType(MethodType meth); MethodConfigBuilder setSocketTimeout(int socketTimeout); MethodConfigBuilder setConnectionTimeout(int connectionTimeout); MethodConfigBuilder setDeserializer(Class<? extends Deserializer> deserializerClass); MethodConfigBuilder setRequestInterceptor(Class<? extends RequestInterceptor> requestInterceptorClass); MethodConfigBuilder setResponseHandler(Class<? extends ResponseHandler> responseHandlerClass); MethodConfigBuilder setErrorHandler(Class<? extends ErrorHandler> errorHandlerClass); MethodConfigBuilder setRetryHandler(Class<? extends RetryHandler> retryHandlerClass); MethodConfigBuilder setEntityWriter(Class<? extends EntityWriter> entityWriterClass); MethodConfigBuilder setParamsSerializer(Class<? extends Serializer> serializerClass); MethodConfigBuilder setParamsEncoded(boolean encoded); MethodConfigBuilder setParamsListSeparator(String listSeparator); @Override String toString(); }
DefaultMethodConfigBuilder extends ConfigBuilder implements MethodConfigBuilder { public MethodConfig build() throws Exception { validate(); ParamConfig[] pConfigMethod = buildParams(methodParamConfigBuilders); ParamConfig[] pExtraParams = merge(ParamConfig.class, extraParams, buildParams(extraParamBuilders)); ParamConfig[] allParams = merge(ParamConfig.class, pConfigMethod, pExtraParams); return new DefaultMethodConfig( charset, method, RegexPathTemplate.create(buildPath()), produces, arrify(this.consumes, String.class), meth, socketTimeout, connectionTimeout, getEntityWriter(allParams), instantiate(requestInterceptor), instantiate(responseHandler), instantiate(errorHandler), instantiate(retryHandler), getDeserializers(), pConfigMethod, pExtraParams ); } DefaultMethodConfigBuilder(InterfaceConfigBuilder parent, Method method, CRestConfig crestConfig, ComponentRegistry<String,Deserializer> mimeDeserializerRegistry, ComponentRegistry<Class<?>, Serializer> classSerializerRegistry); MethodConfig build(); ParamConfigBuilder startParamConfig(int index); ParamConfigBuilder startExtraParamConfig(); MethodConfigBuilder setConsumes(String... mimeTypes); MethodConfigBuilder setCharset(Charset charset); MethodConfigBuilder setProduces(String contentType); MethodConfigBuilder appendPath(String path); MethodConfigBuilder setEndPoint(String endPoint); MethodConfigBuilder setType(MethodType meth); MethodConfigBuilder setSocketTimeout(int socketTimeout); MethodConfigBuilder setConnectionTimeout(int connectionTimeout); MethodConfigBuilder setDeserializer(Class<? extends Deserializer> deserializerClass); MethodConfigBuilder setRequestInterceptor(Class<? extends RequestInterceptor> requestInterceptorClass); MethodConfigBuilder setResponseHandler(Class<? extends ResponseHandler> responseHandlerClass); MethodConfigBuilder setErrorHandler(Class<? extends ErrorHandler> errorHandlerClass); MethodConfigBuilder setRetryHandler(Class<? extends RetryHandler> retryHandlerClass); MethodConfigBuilder setEntityWriter(Class<? extends EntityWriter> entityWriterClass); MethodConfigBuilder setParamsSerializer(Class<? extends Serializer> serializerClass); MethodConfigBuilder setParamsEncoded(boolean encoded); MethodConfigBuilder setParamsListSeparator(String listSeparator); @Override String toString();  }