PathParamAnnotationHandler extends StringBasedAnnotationHandler<PathParam> { @Override public void handleParameterAnnotation(PathParam annotation, ParamConfigBuilder builder) { builder.setType(PATH).setName(ph(annotation.value())); } PathParamAnnotationHandler(CRestConfig crestConfig); @Override void handleParameterAnnotation(PathParam annotation, ParamConfigBuilder builder);  }
@Test public void handleParameterAnnotationShouldSetTypeAndName() throws Exception { when(mockParamConfigBuilder.setType(any(ParamType.class))).thenReturn(mockParamConfigBuilder); when(mockAnnotation.value()).thenReturn("a"); toTest.handleParameterAnnotation(mockAnnotation, mockParamConfigBuilder); verify(mockParamConfigBuilder).setType(ParamType.PATH); verify(mockParamConfigBuilder).setName("a"); verify(mockAnnotation).value(); }
@Test public void handleParameterAnnotationShouldMergePlaceholdersAndSetTypeAndName() throws Exception { when(mockParamConfigBuilder.setType(any(ParamType.class))).thenReturn(mockParamConfigBuilder); when(mockAnnotation.value()).thenReturn(VAL_WITH_PH); toTest.handleParameterAnnotation(mockAnnotation, mockParamConfigBuilder); verify(mockParamConfigBuilder).setType(ParamType.PATH); verify(mockParamConfigBuilder).setName(EXPECTED_MERGE_VAL); verify(mockAnnotation).value(); }