Search in sources :

Example 1 with EnumerateDatacentersResponse

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));
    }
}
Also used : EnumerateDatacentersResponse(com.vmware.photon.controller.model.adapters.vsphere.DatacenterEnumeratorService.EnumerateDatacentersResponse) Operation(com.vmware.xenon.common.Operation) EnumerateDatacentersRequest(com.vmware.photon.controller.model.adapters.vsphere.DatacenterEnumeratorService.EnumerateDatacentersRequest) Test(org.junit.Test)

Aggregations

EnumerateDatacentersRequest (com.vmware.photon.controller.model.adapters.vsphere.DatacenterEnumeratorService.EnumerateDatacentersRequest)1 EnumerateDatacentersResponse (com.vmware.photon.controller.model.adapters.vsphere.DatacenterEnumeratorService.EnumerateDatacentersResponse)1 Operation (com.vmware.xenon.common.Operation)1 Test (org.junit.Test)1