PathAnnotationHandler extends StringBasedAnnotationHandler<Path> { @Override public void handleInterfaceAnnotation(Path annotation, InterfaceConfigBuilder builder) { builder.appendMethodsPath(ph(annotation.value())); } PathAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(Path annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(Path annotation, MethodConfigBuilder builder);  }
@Test public void handleInterfaceAnnotationShouldSetParamsPath() throws Exception { when(mockAnnotation.value()).thenReturn("a"); toTest.handleInterfaceAnnotation(mockAnnotation, mockInterfaceConfigBuilder); verify(mockAnnotation).value(); verify(mockInterfaceConfigBuilder).appendMethodsPath("a"); }
@Test public void handleInterfaceAnnotationShouldMergePlaceholdersAndSetParamsPath() throws Exception { when(mockAnnotation.value()).thenReturn(VAL_WITH_PH); toTest.handleInterfaceAnnotation(mockAnnotation, mockInterfaceConfigBuilder); verify(mockAnnotation).value(); verify(mockInterfaceConfigBuilder).appendMethodsPath(EXPECTED_MERGE_VAL); }
@Test public void handleInterfaceAnnotationShouldAppendMethodsPathWithAnnotationValue() throws Exception { when(mockAnnotation.value()).thenReturn("a"); toTest.handleInterfaceAnnotation(mockAnnotation, mockInterfaceConfigBuilder); verify(mockInterfaceConfigBuilder).appendMethodsPath("a"); verify(mockAnnotation).value(); }
@Test public void handleInterfaceAnnotationShouldMergePlaceholdersAndAppendMethodsPathWithAnnotationValue() throws Exception { when(mockAnnotation.value()).thenReturn(VAL_WITH_PH); toTest.handleInterfaceAnnotation(mockAnnotation, mockInterfaceConfigBuilder); verify(mockInterfaceConfigBuilder).appendMethodsPath(EXPECTED_MERGE_VAL); verify(mockAnnotation).value(); }