use of com.google.api.services.discovery.model.RestDescription in project endpoints-java by cloudendpoints.
the class DiscoveryGeneratorTest method testWriteDiscovery_FooEndpointWithDescription.
@Test
public void testWriteDiscovery_FooEndpointWithDescription() throws Exception {
RestDescription doc = getDiscovery(context, FooDescriptionEndpoint.class);
RestDescription expected = readExpectedAsDiscovery("foo_with_description_endpoint.json");
compareDiscovery(expected, doc);
}
use of com.google.api.services.discovery.model.RestDescription in project endpoints-java by cloudendpoints.
the class DiscoveryGeneratorTest method testWriteDiscovery_ArrayEndpoint.
@Test
public void testWriteDiscovery_ArrayEndpoint() throws Exception {
RestDescription doc = getDiscovery(new DiscoveryContext(), ArrayEndpoint.class);
RestDescription expected = readExpectedAsDiscovery("array_endpoint.json");
compareDiscovery(expected, doc);
}
use of com.google.api.services.discovery.model.RestDescription in project endpoints-java by cloudendpoints.
the class ProxyingDiscoveryServiceTest method getRestDocument.
@Test
public void getRestDocument() throws Exception {
ProxyingDiscoveryService discoveryService = createDiscoveryService(true);
when(provider.getRestDocument(SERVER_ROOT, API_NAME, API_VERSION)).thenReturn(REST_DOC);
RestDescription actual = discoveryService.getRestDocument(createRequest("discovery/v1/apis/tictactoe/v1/rest"), API_NAME, API_VERSION);
assertThat(actual).isEqualTo(REST_DOC);
}
use of com.google.api.services.discovery.model.RestDescription in project endpoints-java by cloudendpoints.
the class DiscoveryGeneratorTest method testWriteDiscovery_FooEndpointDefaultContext.
@Test
public void testWriteDiscovery_FooEndpointDefaultContext() throws Exception {
RestDescription doc = getDiscovery(new DiscoveryContext(), FooEndpoint.class);
RestDescription expected = readExpectedAsDiscovery("foo_endpoint_default_context.json");
compareDiscovery(expected, doc);
}
use of com.google.api.services.discovery.model.RestDescription in project endpoints-java by cloudendpoints.
the class DiscoveryGeneratorTest method testWriteDiscovery_multipleApisWithSharedSchema.
@Test
public void testWriteDiscovery_multipleApisWithSharedSchema() throws Exception {
// Read in an API that uses a resource with fields that have their own schema, then read in
// another API that uses the same resource. The discovery for the second API should contain
// both schema, rather than just the first one.
getDiscovery(new DiscoveryContext(), EnumEndpointV2.class);
RestDescription doc = getDiscovery(new DiscoveryContext(), EnumEndpoint.class);
RestDescription expected = readExpectedAsDiscovery("enum_endpoint.json");
compareDiscovery(expected, doc);
}
Aggregations