ResponseHandlerAnnotationHandler extends NoOpAnnotationHandler<ResponseHandler> { @Override public void handleMethodAnnotation(ResponseHandler annotation, MethodConfigBuilder builder)throws InvocationTargetException, NoSuchMethodException, IllegalAccessException, InstantiationException { builder.setResponseHandler(annotation.value()); }  @Override void handleInterfaceAnnotation(ResponseHandler annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(ResponseHandler annotation, MethodConfigBuilder builder);  }
@Test public void handleMethodsAnnotationShouldSetResponseHandler() throws Exception { when(mockAnnotation.value()).thenReturn((Class)DefaultResponseHandler.class); toTest.handleMethodAnnotation(mockAnnotation, mockMethodConfigBuilder); verify(mockAnnotation).value(); verify(mockMethodConfigBuilder).setResponseHandler(DefaultResponseHandler.class); }