SerializerAnnotationHandler extends NoOpAnnotationHandler<Serializer> { @Override public void handleMethodAnnotation(Serializer annotation, MethodConfigBuilder builder) throws InvocationTargetException, NoSuchMethodException, IllegalAccessException, InstantiationException { builder.setParamsSerializer(annotation.value()); }  @Override void handleInterfaceAnnotation(Serializer annotation, InterfaceConfigBuilder builder); @Override void handleMethodAnnotation(Serializer annotation, MethodConfigBuilder builder); @Override void handleParameterAnnotation(Serializer annotation, ParamConfigBuilder builder);  }
@Test public void handleMethodsAnnotationShouldSetSerializer() throws Exception { when(mockAnnotation.value()).thenReturn((Class)ToStringSerializer.class); toTest.handleMethodAnnotation(mockAnnotation, mockMethodConfigBuilder); verify(mockAnnotation).value(); verify(mockMethodConfigBuilder).setParamsSerializer(ToStringSerializer.class); }