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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprivate de.iip_ecosphere.platform.support.Serverstatic final Stringstatic final Stringprivate de.iip_ecosphere.platform.deviceMgt.registry.DeviceRegistryAasClientprivate static final Class<?> private de.iip_ecosphere.platform.support.Serverstatic final StringFields inherited from class test.de.iip_ecosphere.platform.support.TestWithPlugin
PROP_AAS_PLUGIN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTest addDevice and provide a valid device.voidTest addDevice and provide a valid device.voidTest getDevice, check that an invalid device is not registered.voidTest getDevice, check that a valid device is registered.voidTest getDevices, assert that devices-list is empty with no devices.voidTest getDevices, assert that devices-list has one device with added device.voidTest the imAlive method and verify that its sending the incomping aas operation request to the registered device registry.voidTests sending telemetry leads to telemetry in the registry.voidsetUp()Setup method, create aas server/registry and deploy the DeviceRegistryAas contributor class.voidtearDown()Teardown method, reset mocks.Methods inherited from class test.de.iip_ecosphere.platform.support.aas.TestWithPlugin
setAasPluginId, setup, setupAASPluginsMethods inherited from class test.de.iip_ecosphere.platform.support.TestWithPlugin
addPluginLocation, addRunAfterLoading, clear, enableLocalPlugins, loadPlugins, setInstallDir
-
Field Details
-
A_DEVICE_ID
- See Also:
-
AN_INVALID_DEVICE_ID
- See Also:
-
SOME_TELEMETRY
- See Also:
-
AN_IP
- See Also:
-
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
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, IOExceptionTest getDevices, assert that devices-list has one device with added device.- Throws:
ExecutionException- should not be thrownIOException- 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
Test getDevice, check that a valid device is registered.- Throws:
ExecutionException- if AAS operations fail, shall not happenIOException- if IO operations fail, shall not happen
-
addDevice_withDevice_shouldAddDevice
Test addDevice and provide a valid device. Should add the device.- Throws:
ExecutionException- should not be thrownIOException- should not be thrown
-
addDevice_invalidDevice
Test addDevice and provide a valid device. Should add the device.- Throws:
ExecutionException- should not be thrownIOException- should not be thrown
-
sendTelemetry_withDeviceAndTelementry_shouldSendTelemetryToRegistry
public void sendTelemetry_withDeviceAndTelementry_shouldSendTelemetryToRegistry() throws ExecutionExceptionTests sending telemetry leads to telemetry in the registry.- Throws:
ExecutionException- should not be thrown
-
imAlive_withDevice_shouldCallImAliveFromRegistry
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
-