ProducesAnnotationHandler extends StringBasedAnnotationHandler<Produces> { @Override public void handleMethodAnnotation(Produces annotation, MethodConfigBuilder builder) { builder.setProduces(ph(annotation.value())); } ProducesAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(Produces annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(Produces annotation, MethodConfigBuilder builder);  }
@Test public void handleMethodsAnnotationShouldSetProduces() throws Exception { when(mockAnnotation.value()).thenReturn("a"); toTest.handleMethodAnnotation(mockAnnotation, mockMethodConfigBuilder); verify(mockAnnotation).value(); verify(mockMethodConfigBuilder).setProduces("a"); }
@Test public void handleMethodsAnnotationShouldMergePlaceholdersAndSetProduces() throws Exception { when(mockAnnotation.value()).thenReturn(VAL_WITH_PH); toTest.handleMethodAnnotation(mockAnnotation, mockMethodConfigBuilder); verify(mockAnnotation).value(); verify(mockMethodConfigBuilder).setProduces(EXPECTED_MERGE_VAL); }