ConsumesAnnotationHandler extends StringBasedAnnotationHandler<Consumes> { @Override public void handleInterfaceAnnotation(Consumes annotation, InterfaceConfigBuilder builder) { builder.setMethodsConsumes(ph(annotation.value())); } ConsumesAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(Consumes annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(Consumes annotation, MethodConfigBuilder builder);  }
@Test public void handleInterfaceAnnotationShouldSetMethodsConsumes() throws Exception { when(mockAnnotation.value()).thenReturn(new String[]{"a","b"}); toTest.handleInterfaceAnnotation(mockAnnotation, mockInterfaceConfigBuilder); verify(mockAnnotation).value(); verify(mockInterfaceConfigBuilder).setMethodsConsumes("a","b"); }
@Test public void handleInterfaceAnnotationShouldReplacePlaceholdersAndSetMethodsConsumes() throws Exception { when(mockAnnotation.value()).thenReturn(new String[]{VAL_WITH_PH + "a",VAL_WITH_PH + "b"}); toTest.handleInterfaceAnnotation(mockAnnotation, mockInterfaceConfigBuilder); verify(mockAnnotation).value(); verify(mockInterfaceConfigBuilder).setMethodsConsumes(EXPECTED_MERGE_VAL + "a",EXPECTED_MERGE_VAL + "b"); }