@Test
public void testGetSerializerTypeWithIncompatibleSourceType() throws Exception {

  try {
    ApiConfig config = new ApiConfig.Factory().create(
        ServiceContext.create(), new TypeLoader(), TestEndpoint.class);
    ApiAnnotationIntrospector.getSchemaType(TypeToken.of(BadSerializerBean.class), config);
    fail("no exception thrown when a bad serializer was specified");
  } catch (IllegalArgumentException e) {
    // expected
  }
}