use of com.vmware.photon.controller.model.adapters.vsphere.DatacenterEnumeratorService.EnumerateDatacentersResponse in project photon-model by vmware.
the class TestDatacenterListerService method listDatacenters.
@Test
public void listDatacenters() {
EnumerateDatacentersRequest req = new EnumerateDatacentersRequest();
req.host = URI.create(vcUrl).getHost();
req.username = vcUsername;
req.password = vcPassword;
req.isMock = isMock();
Operation op = Operation.createPatch(this.host, VSphereUriPaths.DC_ENUMERATOR_SERVICE).setBody(req);
op = this.host.waitForResponse(op);
assertEquals(Operation.STATUS_CODE_OK, op.getStatusCode());
assertNotNull(op.getBodyRaw());
if (!isMock()) {
EnumerateDatacentersResponse resp = op.getBody(EnumerateDatacentersResponse.class);
assertTrue(resp.datacenters.contains(datacenterId));
}
}
Aggregations