100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
Wait for gateway child registration before cleanup (#3384)
Wouter Born045d710ab132
diff --git a/test/src/test/groovy/org/openremote/test/gateway/AbstractGatewayCompatibilityTest.groovy b/test/src/test/groovy/org/openremote/test/gateway/AbstractGatewayCompatibilityTest.groovyindex 2f4dc3278..d59f7542d 100644--- a/test/src/test/groovy/org/openremote/test/gateway/AbstractGatewayCompatibilityTest.groovy+++ b/test/src/test/groovy/org/openremote/test/gateway/AbstractGatewayCompatibilityTest.groovy@@ -136,21 +136,28 @@ abstract class AbstractGatewayCompatibilityTest extends Specification implementsprotected void assertCompatibilityConnected(GatewayAsset gateway, List<SharedEvent> receivedEvents, String version, boolean timeoutManagementSupported) {awaitGatewayEvent(receivedEvents, GatewayInitDoneEvent)+def storage = container.getService(AssetStorageService)+ def gatewayService = container.getService(GatewayService)def conditions = new PollingConditions(timeout: 15, delay: 0.1)+conditions.eventually {- def connector = container.getService(GatewayService).gatewayConnectorMap.get(gateway.id.toLowerCase(Locale.ROOT))+ def connector = gatewayService.gatewayConnectorMap.get(gateway.id.toLowerCase(Locale.ROOT))+assert connector.isConnected()assert !connector.isInitialSyncInProgress()assert connector.isTunnellingSupported()assert connector.gatewayVersion == versionassert connector.isTunnelTimeoutManagementSupported() == timeoutManagementSupported+def connectedGateway = storage.find(gateway.id) as GatewayAssetassert connectedGateway.gatewayStatus.orElse(null) == ConnectionStatus.CONNECTEDassert connectedGateway.tunnelingSupported.orElse(false)def syncedAssets = storage.findAll(new AssetQuery().parents(gateway.id).recursive(true))+assert syncedAssets.size() == 1+def asset = syncedAssets.first()assert asset.id == mapAssetId(gateway.id, "0123456789ABCDEFGHIJKL", false)assert asset.parentId == gateway.id@@ -158,6 +165,9 @@ abstract class AbstractGatewayCompatibilityTest extends Specification implementsassert asset.type == ThingAsset.DESCRIPTOR.nameassert asset.name == "Compatibility asset"assert asset.getAttribute("temperature").flatMap { it.value }.orElse(null) == 21.5++ // Ensure GatewayService has processed the asynchronous persistence event+ assert gatewayService.getLocallyRegisteredGatewayId(asset.id, null) == gateway.id}}@@ -165,7 +175,7 @@ abstract class AbstractGatewayCompatibilityTest extends Specification implementsclient?.disconnect()client?.removeAllMessageConsumers()if (gateway != null) {- container.getService(AssetStorageService).delete([gateway.id])+ assert container.getService(AssetStorageService).delete([gateway.id])def conditions = new PollingConditions(timeout: 15, delay: 0.1)conditions.eventually {assert !container.getService(GatewayService).gatewayConnectorMap.containsKey(gateway.id.toLowerCase(Locale.ROOT))