EntityWriterAnnotationHandler extends NoOpAnnotationHandler<EntityWriter> { @Override public void handleMethodAnnotation(EntityWriter annotation, MethodConfigBuilder builder) throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { builder.setEntityWriter(annotation.value()); }  @Override void handleInterfaceAnnotation(EntityWriter annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(EntityWriter annotation, MethodConfigBuilder builder);  }
@Test public void handleMethodsAnnotationShouldSetEntityWriter() throws Exception { when(mockAnnotation.value()).thenReturn((Class)UrlEncodedFormEntityWriter.class); toTest.handleMethodAnnotation(mockAnnotation, mockMethodConfigBuilder); verify(mockAnnotation).value(); verify(mockMethodConfigBuilder).setEntityWriter(UrlEncodedFormEntityWriter.class); }