use of com.google.api.server.spi.config.validation.InvalidReturnTypeException in project endpoints-java by cloudendpoints.
the class JsonConfigWriterTest method enumResponseIsBlocked.
@Test
public void enumResponseIsBlocked() throws Exception {
final class Endpoint {
@SuppressWarnings("unused")
public TestEnum get() {
return TestEnum.A;
}
}
new ApiConfigAnnotationReader().loadEndpointMethods(serviceContext, Endpoint.class, apiConfig.getApiClassConfig().getMethods());
try {
writer.writeConfig(Collections.singleton(apiConfig));
fail();
} catch (InvalidReturnTypeException e) {
// Expected.
}
}
use of com.google.api.server.spi.config.validation.InvalidReturnTypeException in project endpoints-java by cloudendpoints.
the class JsonConfigWriterTest method primitiveResponseIsBlocked.
@Test
public void primitiveResponseIsBlocked() throws Exception {
final class Endpoint {
@SuppressWarnings("unused")
public int get() {
return 4;
}
}
new ApiConfigAnnotationReader().loadEndpointMethods(serviceContext, Endpoint.class, apiConfig.getApiClassConfig().getMethods());
try {
writer.writeConfig(Collections.singleton(apiConfig));
fail();
} catch (InvalidReturnTypeException e) {
// Expected.
}
}
Aggregations