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