Search in sources :

Example 1 with PropertyParameterNameConflictException

use of com.google.api.server.spi.config.validation.PropertyParameterNameConflictException in project endpoints-java by cloudendpoints.

the class JsonConfigWriterTest method bodyFieldConflictsWithParameter.

@Test
@Ignore("ignored until we find a proper solution")
public void bodyFieldConflictsWithParameter() throws Exception {
    final class Endpoint {

        @SuppressWarnings("unused")
        public void set(@Named("date") String id, Bean resource) {
        }
    }
    new ApiConfigAnnotationReader().loadEndpointMethods(serviceContext, Endpoint.class, apiConfig.getApiClassConfig().getMethods());
    try {
        writer.writeConfig(Collections.singleton(apiConfig));
        fail();
    } catch (PropertyParameterNameConflictException e) {
    // Expected.
    }
}
Also used : ApiConfigAnnotationReader(com.google.api.server.spi.config.annotationreader.ApiConfigAnnotationReader) Named(javax.inject.Named) PropertyParameterNameConflictException(com.google.api.server.spi.config.validation.PropertyParameterNameConflictException) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

ApiConfigAnnotationReader (com.google.api.server.spi.config.annotationreader.ApiConfigAnnotationReader)1 PropertyParameterNameConflictException (com.google.api.server.spi.config.validation.PropertyParameterNameConflictException)1 Named (javax.inject.Named)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1