@Test public void testDeviceMetaIsFetchedFromDMS() { Device device = mock(Device.class); when(m_deviceDao.getDeviceByName("Bangalore-south")).thenReturn(device); assertEquals(device, m_dm.getDevice("Bangalore-south")); verify(m_deviceDao).getDeviceByName("Bangalore-south"); }
@Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class}) public Device getDevice(String deviceName) { Device device = m_deviceDao.getDeviceByName(deviceName); if (device == null) { throw new IllegalArgumentException("Device " + deviceName + " does not exist"); } return device; }
DeviceManagerImpl implements DeviceManager { @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class}) public Device getDevice(String deviceName) { Device device = m_deviceDao.getDeviceByName(deviceName); if (device == null) { throw new IllegalArgumentException("Device " + deviceName + " does not exist"); } return device; } }
DeviceManagerImpl implements DeviceManager { @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class}) public Device getDevice(String deviceName) { Device device = m_deviceDao.getDeviceByName(deviceName); if (device == null) { throw new IllegalArgumentException("Device " + deviceName + " does not exist"); } return device; } DeviceManagerImpl(DeviceDao deviceDao); }
DeviceManagerImpl implements DeviceManager { @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class}) public Device getDevice(String deviceName) { Device device = m_deviceDao.getDeviceByName(deviceName); if (device == null) { throw new IllegalArgumentException("Device " + deviceName + " does not exist"); } return device; } DeviceManagerImpl(DeviceDao deviceDao); void setDeviceDao(DeviceDao deviceDao); @Override void deviceAdded(String deviceName); @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class}) Device getDevice(String deviceName); @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class}) List<Device> getAllDevices(); @Override void deviceRemoved(String deviceName); @Override void devicePropertyChanged(String deviceName); @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class}) void updateConfigAlignmentState(String deviceName, String verdict); @Override void removeDeviceStateProvider(DeviceStateProvider stateProvider); @Override void addDeviceStateProvider(DeviceStateProvider stateProvider); }
DeviceManagerImpl implements DeviceManager { @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class}) public Device getDevice(String deviceName) { Device device = m_deviceDao.getDeviceByName(deviceName); if (device == null) { throw new IllegalArgumentException("Device " + deviceName + " does not exist"); } return device; } DeviceManagerImpl(DeviceDao deviceDao); void setDeviceDao(DeviceDao deviceDao); @Override void deviceAdded(String deviceName); @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class}) Device getDevice(String deviceName); @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class}) List<Device> getAllDevices(); @Override void deviceRemoved(String deviceName); @Override void devicePropertyChanged(String deviceName); @Override @Transactional(value = Transactional.TxType.REQUIRED, rollbackOn = {RuntimeException.class}) void updateConfigAlignmentState(String deviceName, String verdict); @Override void removeDeviceStateProvider(DeviceStateProvider stateProvider); @Override void addDeviceStateProvider(DeviceStateProvider stateProvider);  }