> + MockWebServer server = mockWebServer();
> + server.enqueue(new
> MockResponse().setBody(payloadFromResource("/datacenter/datacenters.xml")));
> +
> + ProfitBricksApi pbApi = api(server.getUrl(rootUrl));
> + DataCenterApi api = pbApi.dataCenterApi();
> +
> + try {
> + List<DataCenter> dataCenters = api.getAllDataCenters();
> + assertRequestHasCommonProperties(server.takeRequest());
> + assertNotNull(dataCenters);
> + assertEquals(dataCenters.size(), 2);
> + } finally {
> + pbApi.close();
> + server.shutdown();
> + }
> + }
Add also a test that verifies what happens when the server returns a 404. There
is an explicit fallback in the method definition, so we should test it is
taking place when needed.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/72/files#r22460232