@Test public void handleMethodAnnotationShouldFillProducesWithFirstAnnotationValue() throws Exception { when(mockAnnotation.value()).thenReturn(new String[]{"a","b"}); when(mockMethodConfigBuilder.setProduces("a")).thenReturn(mockMethodConfigBuilder); toTest.handleMethodAnnotation(mockAnnotation, mockMethodConfigBuilder); verify(mockAnnotation, times(2)).value(); verify(mockMethodConfigBuilder).setProduces("a"); }
@Override public void handleMethodAnnotation(Consumes annotation, MethodConfigBuilder builder) { if(annotation.value().length >= 1) { builder.setProduces(ph(annotation.value()[0])); } }
ConsumesAnnotationHandler extends StringBasedAnnotationHandler<Consumes> { @Override public void handleMethodAnnotation(Consumes annotation, MethodConfigBuilder builder) { if(annotation.value().length >= 1) { builder.setProduces(ph(annotation.value()[0])); } } }
ConsumesAnnotationHandler extends StringBasedAnnotationHandler<Consumes> { @Override public void handleMethodAnnotation(Consumes annotation, MethodConfigBuilder builder) { if(annotation.value().length >= 1) { builder.setProduces(ph(annotation.value()[0])); } } ConsumesAnnotationHandler(CRestConfig crestConfig); }
ConsumesAnnotationHandler extends StringBasedAnnotationHandler<Consumes> { @Override public void handleMethodAnnotation(Consumes annotation, MethodConfigBuilder builder) { if(annotation.value().length >= 1) { builder.setProduces(ph(annotation.value()[0])); } } ConsumesAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(Consumes annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(Consumes annotation, MethodConfigBuilder builder); }
ConsumesAnnotationHandler extends StringBasedAnnotationHandler<Consumes> { @Override public void handleMethodAnnotation(Consumes annotation, MethodConfigBuilder builder) { if(annotation.value().length >= 1) { builder.setProduces(ph(annotation.value()[0])); } } ConsumesAnnotationHandler(CRestConfig crestConfig); @Override void handleInterfaceAnnotation(Consumes annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(Consumes annotation, MethodConfigBuilder builder);  }