use of com.google.api.services.discovery.model.RestDescription in project endpoints-java by cloudendpoints.
the class DiscoveryGeneratorTest method testWriteDiscovery_FooEndpointLocalhost.
@Test
public void testWriteDiscovery_FooEndpointLocalhost() throws Exception {
RestDescription doc = getDiscovery(new DiscoveryContext().setApiRoot("http://localhost:8080/api"), FooEndpoint.class);
RestDescription expected = readExpectedAsDiscovery("foo_endpoint_localhost.json");
compareDiscovery(expected, doc);
}
use of com.google.api.services.discovery.model.RestDescription in project endpoints-java by cloudendpoints.
the class DiscoveryGeneratorTest method testWriteDiscovery_parameterOrder.
@Test
public void testWriteDiscovery_parameterOrder() throws Exception {
RestDescription doc = getDiscovery(new DiscoveryContext(), MultipleParameterEndpoint.class);
RestDescription expected = readExpectedAsDiscovery("multiple_parameter_endpoint.json");
compareDiscovery(expected, doc);
}
use of com.google.api.services.discovery.model.RestDescription in project endpoints-java by cloudendpoints.
the class ProxyingDiscoveryProviderTest method getRestDocument.
@Test
public void getRestDocument() throws Exception {
when(restRequest.execute()).thenReturn(REST_DOC);
RestDescription actual = provider.getRestDocument(REWRITTEN_ROOT, NAME, V1);
assertThat(actual).isEqualTo(REST_DOC);
verify(apis).generateRest(new com.google.api.services.discovery.model.ApiConfig().setConfig(V1_JSON_API_CONFIG));
}
use of com.google.api.services.discovery.model.RestDescription in project endpoints-java by cloudendpoints.
the class DiscoveryGeneratorTest method testWriteDiscovery_AbsoluteCommonPathEndpoint.
@Test
public void testWriteDiscovery_AbsoluteCommonPathEndpoint() throws Exception {
RestDescription doc = getDiscovery(context, AbsoluteCommonPathEndpoint.class);
RestDescription expected = readExpectedAsDiscovery("absolute_common_path_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_newHostname.
@Test
public void testWriteDiscovery_newHostname() throws Exception {
RestDescription doc = getDiscovery(new DiscoveryContext().setApiRoot("http://notlocalhost/api").setHostname("localhost:8080"), FooEndpoint.class);
RestDescription expected = readExpectedAsDiscovery("foo_endpoint_localhost.json");
compareDiscovery(expected, doc);
}
Aggregations