HttpResponse queryResponse= HttpResponse.builder()
.statusCode(200)
.payload(payloadFromResourceWithContentType("/query/admin/allRoles.xml", VCloudDirectorMediaType.QUERY_RESULT_RECORDS + ";version=1.5"))
.build();
VCloudDirectorAdminApi api = requestsSendResponses(loginRequest, sessionResponse, queryRequest, queryResponse);
QueryResultRecords expected = QueryResultRecords.builder()
.href(URI.create("https://vcloudbeta.bluelock.com/api/admin/roles/query?page=1&pageSize=25&format=records"))
.type("application/vnd.vmware.vcloud.query.records+xml")
.name("role")
.page(1)
.pageSize(25)
.total(1L)
.link(Link.builder()
.rel("alternate")
.type("application/vnd.vmware.vcloud.query.references+xml")
.href(URI.create("https://vcloudbeta.bluelock.com/api/admin/roles/query?page=1&pageSize=25&format=references"))
.build())
.link(Link.builder()
.rel("alternate")
.type("application/vnd.vmware.vcloud.query.idrecords+xml")
.href(URI.create("https://vcloudbeta.bluelock.com/api/admin/roles/query?page=1&pageSize=25&format=idrecords"))
.build())
.record(QueryResultRoleRecord.builder()
.href(URI.create("https://vcloudbeta.bluelock.com/api/admin/role/1bf4457f-a253-3cf1-b163-f319f1a31802"))
.name("vApp Author")
.isReadOnly(false)
.build())
.build();
assertEquals(api.getQueryApi().rolesQueryAll(), expected);
}