PathAnnotationHandler extends StringBasedAnnotationHandler<Path> { @Override public void handleMethodAnnotation(Path annotation, MethodConfigBuilder builder) { builder.appendPath(ph(annotation.value())); } PathAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(Path annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(Path annotation, MethodConfigBuilder builder);  }
@Test public void handleMethodsAnnotationShouldSetPath() throws Exception { when(mockAnnotation.value()).thenReturn("a"); toTest.handleMethodAnnotation(mockAnnotation, mockMethodConfigBuilder); verify(mockAnnotation).value(); verify(mockMethodConfigBuilder).appendPath("a"); }
@Test public void handleMethodsAnnotationShouldMergePlaceholdersAndSetPath() throws Exception { when(mockAnnotation.value()).thenReturn(VAL_WITH_PH); toTest.handleMethodAnnotation(mockAnnotation, mockMethodConfigBuilder); verify(mockAnnotation).value(); verify(mockMethodConfigBuilder).appendPath(EXPECTED_MERGE_VAL); }
@Test public void handleMethodAnnotationShouldAppendPathWithAnnotationValue() throws Exception { when(mockAnnotation.value()).thenReturn("a"); toTest.handleMethodAnnotation(mockAnnotation, mockMethodConfigBuilder); verify(mockMethodConfigBuilder).appendPath("a"); verify(mockAnnotation).value(); }
@Test public void handleMethodAnnotationShouldMergePlaceholdersAndAppendPathWithAnnotationValue() throws Exception { when(mockAnnotation.value()).thenReturn(VAL_WITH_PH); toTest.handleMethodAnnotation(mockAnnotation, mockMethodConfigBuilder); verify(mockMethodConfigBuilder).appendPath(EXPECTED_MERGE_VAL); verify(mockAnnotation).value(); }