@Test public void handleParameterAnnotationShouldMergePlaceholdersSetTypeAndNameAndDefaultValue() 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(VAL_WITH_PH + "a"); when(mockAnnotation.defaultValue()).thenReturn(VAL_WITH_PH + "b"); toTest.handleParameterAnnotation(mockAnnotation, super.mockParamConfigBuilder); verify(super.mockParamConfigBuilder).setType(ParamType.COOKIE); verify(super.mockParamConfigBuilder).setName(EXPECTED_MERGE_VAL + "a"); verify(super.mockParamConfigBuilder).setDefaultValue(EXPECTED_MERGE_VAL + "b"); verify(mockAnnotation).value(); verify(mockAnnotation).defaultValue(); }
@Override public void handleParameterAnnotation(CookieParam annotation, ParamConfigBuilder builder) { builder.setType(COOKIE) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); }
CookieParamAnnotationHandler extends ParamAnnotationHandler<CookieParam> { @Override public void handleParameterAnnotation(CookieParam annotation, ParamConfigBuilder builder) { builder.setType(COOKIE) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } }
CookieParamAnnotationHandler extends ParamAnnotationHandler<CookieParam> { @Override public void handleParameterAnnotation(CookieParam annotation, ParamConfigBuilder builder) { builder.setType(COOKIE) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } CookieParamAnnotationHandler(CRestConfig crestConfig); }
CookieParamAnnotationHandler extends ParamAnnotationHandler<CookieParam> { @Override public void handleParameterAnnotation(CookieParam annotation, ParamConfigBuilder builder) { builder.setType(COOKIE) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } CookieParamAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(CookieParam annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(CookieParam annotation, MethodConfigBuilder builder); @Override void handleParameterAnnotation(CookieParam annotation, ParamConfigBuilder builder); }
CookieParamAnnotationHandler extends ParamAnnotationHandler<CookieParam> { @Override public void handleParameterAnnotation(CookieParam annotation, ParamConfigBuilder builder) { builder.setType(COOKIE) .setName(ph(annotation.value())) .setDefaultValue(nullIfUnset(ph(annotation.defaultValue()))); } CookieParamAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(CookieParam annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(CookieParam annotation, MethodConfigBuilder builder); @Override void handleParameterAnnotation(CookieParam annotation, ParamConfigBuilder builder);  }