use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.
the class BackendInstanceTypeWatchdogResourceTest 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 BackendInstanceTypeWatchdogResourceTest method testUpdate.
@Test
public void testUpdate() throws Exception {
setUpEntityQueryExpectations(2);
setUriInfo(setUpActionExpectations(ActionType.UpdateWatchdog, WatchdogParameters.class, new String[] { "Id" }, new Object[] { INSTANCE_TYPE_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 BackendInstanceTypeWatchdogsResourceTest method getModel.
private Watchdog getModel() {
Watchdog watchDog = new Watchdog();
watchDog.setAction(WatchdogAction.RESET);
watchDog.setModel(WatchdogModel.I6300ESB);
watchDog.setId(WATCHDOG_ID.toString());
return watchDog;
}
use of org.ovirt.engine.api.model.Watchdog in project ovirt-engine by oVirt.
the class BackendInstanceTypeWatchdogsResourceTest 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 WatchdogMapper method map.
@Mapping(from = VmWatchdog.class, to = Watchdog.class)
public static Watchdog map(VmWatchdog entity, Watchdog template) {
Watchdog model = template == null ? new Watchdog() : template;
if (entity.getAction() != null) {
model.setAction(map(entity.getAction()));
}
if (entity.getModel() != null) {
model.setModel(map(entity.getModel()));
}
model.setId(entity.getId().toString());
return model;
}
Aggregations