use of org.ovirt.engine.api.model.NetworkLabel in project ovirt-engine by oVirt.
the class BackendHostNicLabelsResourceTest method testAdd.
@Test
public void testAdd() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpCreationExpectations(ActionType.LabelNic, LabelNicParameters.class, new String[] { "NicId", "Label" }, new Object[] { nicId, LABELS[0] }, true, true, LABELS[0], QueryType.GetNetworkLabelsByHostNicId, IdQueryParameters.class, new String[] { "Id" }, new Object[] { nicId }, asList(getEntity(0)));
Response response = collection.add(getModel(0));
assertEquals(201, response.getStatus());
assertTrue(response.getEntity() instanceof NetworkLabel);
verifyModel((NetworkLabel) response.getEntity(), 0);
}
use of org.ovirt.engine.api.model.NetworkLabel in project ovirt-engine by oVirt.
the class AbstractBaseHostNicLabelsResource method addLinks.
@Override
protected NetworkLabel addLinks(NetworkLabel label, Class<? extends BaseResource> suggestedParent, String... excludeSubCollectionMembers) {
NetworkLabel resultLabel = super.addLinks(label, HostNic.class);
final AbstractBaseHostNicLabelResource labelResource = createSingularResource(resultLabel.getId());
labelResource.overrideHref(resultLabel);
return resultLabel;
}
use of org.ovirt.engine.api.model.NetworkLabel in project ovirt-engine by oVirt.
the class BackendNetworkLabelsResourceTest method getModel.
private NetworkLabel getModel(int i) {
NetworkLabel model = new NetworkLabel();
model.setId(LABELS[i]);
return model;
}
use of org.ovirt.engine.api.model.NetworkLabel in project ovirt-engine by oVirt.
the class BackendNetworkLabelsResourceTest method testAdd.
@Test
public void testAdd() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpCreationExpectations(ActionType.LabelNetwork, LabelNetworkParameters.class, new String[] { "NetworkId", "Label" }, new Object[] { NETWORK_ID, LABELS[0] }, true, true, LABELS[0], QueryType.GetNetworkLabelsByNetworkId, IdQueryParameters.class, new String[] { "Id" }, new Object[] { NETWORK_ID }, asList(getEntity(0)));
Response response = collection.add(getModel(0));
assertEquals(201, response.getStatus());
assertTrue(response.getEntity() instanceof NetworkLabel);
verifyModel((NetworkLabel) response.getEntity(), 0);
}
use of org.ovirt.engine.api.model.NetworkLabel in project ovirt-engine by oVirt.
the class BackendNetworkLabelResourceTest method testGet.
@Test
public void testGet() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpEntityQueryExpectations(getEntityList());
NetworkLabel model = resource.get();
assertEquals(LABELS[0], model.getId());
verifyLinks(model);
}
Aggregations