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