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