@Test
public void testSerializerTypeMismatch() throws Exception {

  final class TestSerializer extends DefaultValueSerializer<String, Boolean> {}
  config.getApiClassConfig().getMethods()
      .get(methodToEndpointMethod(TestEndpoint.class.getMethod("getResultNoParams")))
      .addParameter("param", null, false, null, TypeToken.of(Integer.class))
      .setSerializer(TestSerializer.class);
  try {
    validator.validate(config);
    fail("Expected WrongSerializerTypeException.");
  } catch (WrongTransformerTypeException expected) {
  }
}