Class IntegrationTests

java.lang.Object
de.iip_ecosphere.platform.deviceMgt.thingsboard.IntegrationTests

public class IntegrationTests extends Object
Implements the setup.
Author:
Holger Eichelberger, SSE
  • Field Details

    • A_DEVICE

      public static final String A_DEVICE
      See Also:
    • AN_IP

      public static final String AN_IP
      See Also:
    • registry

      private de.iip_ecosphere.platform.deviceMgt.thingsboard.ThingsBoardDeviceRegistry registry
    • restClient

      private org.thingsboard.rest.client.RestClient restClient
  • Constructor Details

    • IntegrationTests

      public IntegrationTests()
  • Method Details

    • setUp

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

      public void tearDown()
      Cleans up after testing.
    • restClientIsAbleToConnect

      public void restClientIsAbleToConnect()
      Tests that the REST client is able to connect.
    • createDeviceRegistryInstance_createsInstance

      public void createDeviceRegistryInstance_createsInstance()
      Tests that creating a device registry creats an instance.
    • addDevice_withDevice_shouldAddDevice

      public void addDevice_withDevice_shouldAddDevice()
      Tests adding a valid device works.
    • addDevice_withOutDevice_shouldNotAddDevice

      public void addDevice_withOutDevice_shouldNotAddDevice()
      Tests adding an invalid device does not work.
    • addMultipleDevices_shouldAddAllDevices

      public void addMultipleDevices_shouldAddAllDevices()
      Tests that adding multiple devices adds all devices.
    • removeDevice_removesDevice

      public void removeDevice_removesDevice()
      Tests that removing a device works.
    • addDevice_withDeviceAndIp_hasDeviceIdInternalIdAndIp

      public void addDevice_withDeviceAndIp_hasDeviceIdInternalIdAndIp()
      Tests that a device has a valid id/ip.
    • getState_withDeviceAddedButNoAlive_shouldBeSTARTING

      public void getState_withDeviceAddedButNoAlive_shouldBeSTARTING()
      Tests that an added, none alive device shall be starting.
    • getState_withDeviceAddedAndAlive_shouldBeAVAILABLE

      public void getState_withDeviceAddedAndAlive_shouldBeAVAILABLE() throws ExecutionException
      Tests that an added, alive device shall be available.
      Throws:
      ExecutionException - if AAS operations fail, shall not occur
    • getState_withTimedOutDevice_shouldBeUNDEFINED

      public void getState_withTimedOutDevice_shouldBeUNDEFINED() throws ExecutionException, InterruptedException
      Tests that a timed out device shall be undefined.
      Throws:
      ExecutionException - if AAS operations fail, shall not occur
      InterruptedException - if timeouts occur, shall not happe
    • getRuntime_withValidDevice_returnsNull

      public void getRuntime_withValidDevice_returnsNull()
      Tests that getting a device descriptor returns valid data.
    • generateRandomIds

      static List<String> generateRandomIds(int count)
      Generates a given number of random ids.
      Parameters:
      count - the number of ids to generate
      Returns:
      the random ids