use of org.ovirt.engine.api.model.AffinityGroup in project ovirt-engine by oVirt.
the class BackendAffinityGroupResourceTest method getModel.
static AffinityGroup getModel(int index) {
AffinityGroup model = new AffinityGroup();
model.setId(GUIDS[0].toString());
model.setName(NAMES[index]);
model.setDescription(DESCRIPTIONS[index]);
model.setCluster(new Cluster());
model.getCluster().setId(CLUSTER_ID.toString());
model.setEnforcing((GUIDS[index].hashCode() & 1) == 0);
model.setPositive((GUIDS[index].hashCode() & 1) == 1);
return model;
}
use of org.ovirt.engine.api.model.AffinityGroup in project ovirt-engine by oVirt.
the class BackendAffinityGroupsResourceTest method testAdd.
@Test
public void testAdd() {
setUriInfo(setUpBasicUriExpectations());
setUpCreationExpectations(ActionType.AddAffinityGroup, AffinityGroupCRUDParameters.class, new String[] {}, new Object[] {}, true, true, GUIDS[0], QueryType.GetAffinityGroupById, IdQueryParameters.class, new String[] { "Id" }, new Object[] { GUIDS[0] }, getEntity(0));
Response response = collection.add(new AffinityGroup());
assertEquals(201, response.getStatus());
assertTrue(response.getEntity() instanceof AffinityGroup);
verifyModel((AffinityGroup) response.getEntity(), 0);
}
Aggregations