use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.
the class BackendTemplateWatchdogResourceTest method testUpdate.
@Test
public void testUpdate() throws Exception {
setUpEntityQueryExpectations(2);
setUriInfo(setUpActionExpectations(ActionType.UpdateWatchdog, WatchdogParameters.class, new String[] { "Id" }, new Object[] { TEMPLATE_ID }, true, true));
Watchdog wd = resource.update(getUpdate());
assertTrue(wd.isSetAction());
}
use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.
the class BackendTemplateWatchdogResourceTest method getUpdate.
private Watchdog getUpdate() {
Watchdog watchdog = new Watchdog();
watchdog.setId(WATCHDOG_ID.toString());
watchdog.setAction(WatchdogAction.RESET);
watchdog.setModel(WatchdogModel.I6300ESB);
return watchdog;
}
use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.
the class BackendTemplateWatchdogsResourceTest method testAdd.
@Test
public void testAdd() {
setUriInfo(setUpBasicUriExpectations());
setUpCreationExpectations(ActionType.AddWatchdog, WatchdogParameters.class, new String[] {}, new Object[] {}, true, true, WATCHDOG_ID, QueryType.GetWatchdog, IdQueryParameters.class, new String[] { "Id" }, new Object[] { INSTANCE_TYPE_ID }, getEntity());
Watchdog model = getModel();
Response response = collection.add(model);
assertEquals(201, response.getStatus());
assertTrue(response.getEntity() instanceof Watchdog);
verifyModel((Watchdog) response.getEntity());
}
use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.
the class BackendVmWatchdogResourceTest method testGet.
@Test
public void testGet() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpEntityQueryExpectations(1);
Watchdog watchdog = resource.get();
verifyModel(watchdog);
}
use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.
the class BackendVmWatchdogResourceTest method testUpdate.
@Test
public void testUpdate() throws Exception {
setUpEntityQueryExpectations(2);
setUriInfo(setUpActionExpectations(ActionType.UpdateWatchdog, WatchdogParameters.class, new String[] { "Id" }, new Object[] { VM_ID }, true, true));
Watchdog wd = resource.update(getUpdate());
assertTrue(wd.isSetAction());
}
Aggregations