Class DeviceRegistryAasClientTest

java.lang.Object
test.de.iip_ecosphere.platform.support.TestWithPlugin
test.de.iip_ecosphere.platform.support.aas.TestWithPlugin
de.iip_ecosphere.platform.deviceMgt.registry.DeviceRegistryAasClientTest

public class DeviceRegistryAasClientTest extends test.de.iip_ecosphere.platform.support.aas.TestWithPlugin
Tests the DeviceRegistryAas with the help of DeviceRegistryAasClient.
Author:
Dennis Pidun, University of Hildesheim
  • Field Details

    • A_DEVICE_ID

      public static final String A_DEVICE_ID
      See Also:
    • AN_INVALID_DEVICE_ID

      public static final String AN_INVALID_DEVICE_ID
      See Also:
    • SOME_TELEMETRY

      public static final String SOME_TELEMETRY
      See Also:
    • AN_IP

      public static final String AN_IP
      See Also:
    • CONTRIBUTOR_CLASS

      private static final Class<?> CONTRIBUTOR_CLASS
    • implServer

      private de.iip_ecosphere.platform.support.Server implServer
    • aasServer

      private de.iip_ecosphere.platform.support.Server aasServer
    • client

      private de.iip_ecosphere.platform.deviceMgt.registry.DeviceRegistryAasClient client
  • Constructor Details

    • DeviceRegistryAasClientTest

      public DeviceRegistryAasClientTest()
  • Method Details

    • setUp

      public void setUp() throws Exception
      Setup method, create aas server/registry and deploy the DeviceRegistryAas contributor class.
      Throws:
      Exception - should not be thrown
    • tearDown

      public void tearDown()
      Teardown method, reset mocks.
    • getDevices_withNoDevices_shouldReturnEmptyCollection

      public void getDevices_withNoDevices_shouldReturnEmptyCollection()
      Test getDevices, assert that devices-list is empty with no devices.
    • getDevices_withOneDevice_shouldReturnCollectionWithTheOneDevice

      public void getDevices_withOneDevice_shouldReturnCollectionWithTheOneDevice() throws ExecutionException, IOException
      Test getDevices, assert that devices-list has one device with added device.
      Throws:
      ExecutionException - should not be thrown
      IOException - should not be thrown
    • getDevice_withInvalidDevice_shouldReturnNull

      public void getDevice_withInvalidDevice_shouldReturnNull()
      Test getDevice, check that an invalid device is not registered.
    • getDevice_withValidDevice_shouldNotReturnNull

      public void getDevice_withValidDevice_shouldNotReturnNull() throws ExecutionException, IOException
      Test getDevice, check that a valid device is registered.
      Throws:
      ExecutionException - if AAS operations fail, shall not happen
      IOException - if IO operations fail, shall not happen
    • addDevice_withDevice_shouldAddDevice

      public void addDevice_withDevice_shouldAddDevice() throws ExecutionException, IOException
      Test addDevice and provide a valid device. Should add the device.
      Throws:
      ExecutionException - should not be thrown
      IOException - should not be thrown
    • addDevice_invalidDevice

      public void addDevice_invalidDevice() throws ExecutionException, IOException
      Test addDevice and provide a valid device. Should add the device.
      Throws:
      ExecutionException - should not be thrown
      IOException - should not be thrown
    • sendTelemetry_withDeviceAndTelementry_shouldSendTelemetryToRegistry

      public void sendTelemetry_withDeviceAndTelementry_shouldSendTelemetryToRegistry() throws ExecutionException
      Tests sending telemetry leads to telemetry in the registry.
      Throws:
      ExecutionException - should not be thrown
    • imAlive_withDevice_shouldCallImAliveFromRegistry

      public void imAlive_withDevice_shouldCallImAliveFromRegistry() throws ExecutionException
      Test the imAlive method and verify that its sending the incomping aas operation request to the registered device registry.
      Throws:
      ExecutionException - should not be thrown