Boot boot = template != null ? template : new Boot(); Boot.DevicesList list = new Boot.DevicesList(); boot.setDevices(list); List<BootDevice> devices = list.getDevices(); switch (bootSequence) {
.map(BootDevice::fromValue) .forEach(toDevices::add); toBoot.setDevices(toDevicesList); to.setBoot(toBoot);
@Test public void testStartWithBootDev() { setUpWindowsGetEntityExpectations(1, false); setUriInfo(setUpActionExpectations(ActionType.RunVmOnce, RunVmOnceParams.class, new String[] { "VmId", "BootSequence" }, new Object[] { GUIDS[0], BootSequence.N })); Action action = new Action(); action.setVm(new Vm()); action.getVm().setOs(new OperatingSystem()); action.getVm().getOs().setBoot(new Boot()); action.getVm().getOs().getBoot().setDevices(new Boot.DevicesList()); action.getVm().getOs().getBoot().getDevices().getDevices().add(BootDevice.NETWORK); verifyActionResponse(resource.start(action)); }