DefaultValueAnnotationHandler extends StringBasedAnnotationHandler<DefaultValue> { @Override public void handleParameterAnnotation(DefaultValue annotation, ParamConfigBuilder builder) { builder.setDefaultValue(ph(annotation.value())); } DefaultValueAnnotationHandler(CRestConfig crestConfig); @Override void handleParameterAnnotation(DefaultValue annotation, ParamConfigBuilder builder);  }
@Test public void handleParameterAnnotationShouldFillDefaultValueWithAnnotationValue() throws Exception { when(mockAnnotation.value()).thenReturn("a"); when(mockParamConfigBuilder.setDefaultValue("a")).thenReturn(mockParamConfigBuilder); toTest.handleParameterAnnotation(mockAnnotation, mockParamConfigBuilder); verify(mockAnnotation).value(); verify(mockParamConfigBuilder).setDefaultValue("a"); }
@Test public void handleParameterAnnotationShouldMergePlaceholdersAndFillDefaultValueWithAnnotationValue() throws Exception { when(mockAnnotation.value()).thenReturn(VAL_WITH_PH); when(mockParamConfigBuilder.setDefaultValue(EXPECTED_MERGE_VAL)).thenReturn(mockParamConfigBuilder); toTest.handleParameterAnnotation(mockAnnotation, mockParamConfigBuilder); verify(mockAnnotation).value(); verify(mockParamConfigBuilder).setDefaultValue(EXPECTED_MERGE_VAL); }