use of org.ovirt.engine.api.restapi.resource.aaa.BackendUserResource in project ovirt-engine by oVirt.
the class BackendVmSessionsResourceTest method testList.
@Test
public void testList() throws Exception {
BackendUserResource userResourceMock = mock(BackendUserResource.class);
resource.setUserResource(userResourceMock);
resource.setUriInfo(setUpBasicUriExpectations());
setUpGetEntityExpectations(QueryType.GetVmByVmId, IdQueryParameters.class, new String[] { "Id" }, new Object[] { GUIDS[0] }, getEntity(0));
setUpGetEntityExpectations(QueryType.GetDbUserByUserNameAndDomain, GetDbUserByUserNameAndDomainQueryParameters.class, new String[] { "UserName", "DomainName" }, new Object[] { "admin", "internal" }, null);
Sessions sessions = resource.list();
assertEquals(2, sessions.getSessions().size());
assertNotNull(sessions.getSessions().get(0).getVm());
assertNotNull(sessions.getSessions().get(1).getVm());
assertNotNull(sessions.getSessions().get(0).getId());
assertNotNull(sessions.getSessions().get(1).getId());
}
use of org.ovirt.engine.api.restapi.resource.aaa.BackendUserResource in project ovirt-engine by oVirt.
the class BackendVmSessionsResource method getUserResource.
private BackendUserResource getUserResource() {
if (this.userResource == null) {
BackendUsersResource usersResource = new BackendUsersResource();
inject(usersResource);
UserResource userResource = usersResource.getUserResource("");
this.userResource = (BackendUserResource) userResource;
}
return this.userResource;
}
Aggregations