Class BasicDeviceRegistryTest
java.lang.Object
de.iip_ecosphere.platform.deviceMgt.basicReg.BasicDeviceRegistryTest
Tests the basic registry.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTests that adding an already registered device updates the device.voidTests that adding a device with no identifier does not cause adding the device.voidTests that adding a device with no IP does not cause adding the device.voidTests that requesting a device with invalid ID returns null.voidTests that requesting a device with valid ID returns the device.voidTests that requesting a managed device with invalid ID returns null.voidTests that requesting a managed device with valid ID returns the device.voidTests that requesting devices with two devices returns a list with two IDs.voidCleans up after testing.voidTests that requesting managed devices with two devices returns a list with two IDs.voidTests that heartbeats with a valid device leads to telemetry.voidTests that heartbeats with unknown device does not lead to telemetry.voidTests that removing an invalid device (no device information) does not remove a device.voidTests that removing an valid device adds/removes the device.voidTests that sending valid telemetry leads to saved data.voidsetUp()Configures the test before running.
-
Field Details
-
AN_IP
- See Also:
-
ANOTHER_IP
- See Also:
-
ANOTHER_DEVICE
- See Also:
-
A_DEVICE
- See Also:
-
deviceRegistry
private de.iip_ecosphere.platform.deviceMgt.basicReg.BasicDeviceRegistry deviceRegistry
-
-
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, IOExceptionTests that sending valid telemetry leads to saved data.- Throws:
IOException- JSON processing shall not failExecutionException- AAS execution shall not fail
-
imAlive_sendImAliveAsTelemetry
Tests that heartbeats with a valid device leads to telemetry.- Throws:
IOException- JSON processing shall not failExecutionException- AAS execution shall not fail
-
imAlive_withUnknownDevice_shouldNotSendImAliveAsTelemetry
public void imAlive_withUnknownDevice_shouldNotSendImAliveAsTelemetry() throws IOException, ExecutionExceptionTests that heartbeats with unknown device does not lead to telemetry.- Throws:
IOException- JSON processing shall not failExecutionException- AAS execution shall not fail
-