@Test public void handleParameterAnnotationShouldSetTypeAndNameAndDefaultValue() throws Exception { when(super.mockParamConfigBuilder.setType(any(ParamType.class))).thenReturn(super.mockParamConfigBuilder); when(super.mockParamConfigBuilder.setName(any(String.class))).thenReturn(super.mockParamConfigBuilder); when(super.mockParamConfigBuilder.setDefaultValue(anyString())).thenReturn(super.mockParamConfigBuilder); when(mockAnnotation.value()).thenReturn("a"); when(mockAnnotation.defaultValue()).thenReturn("b"); toTest.handleParameterAnnotation(mockAnnotation, super.mockParamConfigBuilder); verify(super.mockParamConfigBuilder).setType(ParamType.HEADER); verify(super.mockParamConfigBuilder).setName("a"); verify(super.mockParamConfigBuilder).setDefaultValue("b"); verify(mockAnnotation).value(); verify(mockAnnotation).defaultValue(); }
@Override public void handleParameterAnnotation(HeaderParam annotation, ParamConfigBuilder builder) { builder.setType(HEADER) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); }
HeaderParamAnnotationHandler extends ParamAnnotationHandler<HeaderParam> { @Override public void handleParameterAnnotation(HeaderParam annotation, ParamConfigBuilder builder) { builder.setType(HEADER) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } }
HeaderParamAnnotationHandler extends ParamAnnotationHandler<HeaderParam> { @Override public void handleParameterAnnotation(HeaderParam annotation, ParamConfigBuilder builder) { builder.setType(HEADER) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } HeaderParamAnnotationHandler(CRestConfig crestConfig); }
HeaderParamAnnotationHandler extends ParamAnnotationHandler<HeaderParam> { @Override public void handleParameterAnnotation(HeaderParam annotation, ParamConfigBuilder builder) { builder.setType(HEADER) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } HeaderParamAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(HeaderParam annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(HeaderParam annotation, MethodConfigBuilder builder); @Override void handleParameterAnnotation(HeaderParam annotation, ParamConfigBuilder builder); }
HeaderParamAnnotationHandler extends ParamAnnotationHandler<HeaderParam> { @Override public void handleParameterAnnotation(HeaderParam annotation, ParamConfigBuilder builder) { builder.setType(HEADER) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } HeaderParamAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(HeaderParam annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(HeaderParam annotation, MethodConfigBuilder builder); @Override void handleParameterAnnotation(HeaderParam annotation, ParamConfigBuilder builder);  }