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