RestModelImporter { public Device importDevice(org.openthinclient.api.rest.model.Device importable) { final Device device = mapper.fromImportable(importable); deviceService.save(device); return device; } RestModelImporter(ImportModelMapper mapper, HardwareTypeService hardwareTypeService, ApplicationService applicationService, ClientService clientService, DeviceService deviceService, LocationService locationService, PrinterService printerService); Device importDevice(org.openthinclient.api.rest.model.Device importable); HardwareType importHardwareType(ImportableHardwareType importable); Printer importPrinter(org.openthinclient.api.rest.model.Printer importable); Location importLocation(ImportableLocation importable); Application importApplication(org.openthinclient.api.rest.model.Application importable); Client importClient(ImportableClient importable); Profile importProfileObject(AbstractProfileObject importable);  }
@Test public void testImportDevice() throws Exception { org.openthinclient.api.rest.model.Device importable = new org.openthinclient.api.rest.model.Device(); importable.setName("A Simple Display"); importable.setSubtype("display"); importable.getConfiguration().setAdditionalProperty("firstscreen.connect", "CRT1"); final Device device = importer.importDevice(importable); assertEquals("A Simple Display", device.getName()); assertEquals("display", device.getSchema(null).getName()); assertEquals("CRT1", device.getValue("firstscreen.connect")); then(deviceService).should().save(any()); }