Class BasicDeviceRegistryTest

java.lang.Object
de.iip_ecosphere.platform.deviceMgt.basicReg.BasicDeviceRegistryTest

public class BasicDeviceRegistryTest extends Object
Tests the basic registry.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • BasicDeviceRegistryTest

      public BasicDeviceRegistryTest()
  • Method Details

    • setUp

      public void setUp()
      Configures the test before running.
    • getIds_withTwoDevices_shouldReturnListWithTwoIds

      public void getIds_withTwoDevices_shouldReturnListWithTwoIds()
      Cleans up after testing.
    • getManagedIds_withTwoDevices_shouldReturnListWithTwoIds

      public void getManagedIds_withTwoDevices_shouldReturnListWithTwoIds()
      Tests that requesting managed devices with two devices returns a list with two IDs.
    • getDevices_withTwoDevices_shouldReturnListWithTwoIds

      public void getDevices_withTwoDevices_shouldReturnListWithTwoIds()
      Tests that requesting devices with two devices returns a list with two IDs.
    • getDevice_withValidId_returnsDevice

      public void getDevice_withValidId_returnsDevice()
      Tests that requesting a device with valid ID returns the device.
    • getDevice_withInvalidId_returnsNull

      public void getDevice_withInvalidId_returnsNull()
      Tests that requesting a device with invalid ID returns null.
    • getDeviceByManagedId_withValidId_returnsDevice

      public void getDeviceByManagedId_withValidId_returnsDevice()
      Tests that requesting a managed device with valid ID returns the device.
    • getDeviceByManagedId_withInvalidId_returnsNull

      public void getDeviceByManagedId_withInvalidId_returnsNull()
      Tests that requesting a managed device with invalid ID returns null.
    • addDevice_withNoIp_wontAddDevice

      public void addDevice_withNoIp_wontAddDevice()
      Tests that adding a device with no IP does not cause adding the device.
    • addDevice_withNoDeviceIdentifier_wontAddDevice

      public void addDevice_withNoDeviceIdentifier_wontAddDevice()
      Tests that adding a device with no identifier does not cause adding the device.
    • addDevice_withAlreadyRegisteredDevice_updatesDevice

      public void addDevice_withAlreadyRegisteredDevice_updatesDevice()
      Tests that adding an already registered device updates the device.
    • removeDevice_withValidDevice_addRemovesDevice

      public void removeDevice_withValidDevice_addRemovesDevice()
      Tests that removing an valid device adds/removes the device.
    • removeDevice_withNoDevice_wontRemoveDevice

      public void removeDevice_withNoDevice_wontRemoveDevice()
      Tests that removing an invalid device (no device information) does not remove a device.
    • sendTelemetry_withValidData_shouldSaveTelemetry

      public void sendTelemetry_withValidData_shouldSaveTelemetry() throws ExecutionException, IOException
      Tests that sending valid telemetry leads to saved data.
      Throws:
      IOException - JSON processing shall not fail
      ExecutionException - AAS execution shall not fail
    • imAlive_sendImAliveAsTelemetry

      public void imAlive_sendImAliveAsTelemetry() throws IOException, ExecutionException
      Tests that heartbeats with a valid device leads to telemetry.
      Throws:
      IOException - JSON processing shall not fail
      ExecutionException - AAS execution shall not fail
    • imAlive_withUnknownDevice_shouldNotSendImAliveAsTelemetry

      public void imAlive_withUnknownDevice_shouldNotSendImAliveAsTelemetry() throws IOException, ExecutionException
      Tests that heartbeats with unknown device does not lead to telemetry.
      Throws:
      IOException - JSON processing shall not fail
      ExecutionException - AAS execution shall not fail