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
Fixed tests
Christian Bauer7e571aa277b0
diff --git a/manager/Dockerfile b/manager/Dockerfileindex 197f80487..82ba5ca81 100644--- a/manager/Dockerfile+++ b/manager/Dockerfile@@ -2,6 +2,7 @@ FROM centos:7RUN yum update -y && yum -y install java-1.8.0-openjdk-devel && yum clean allENV JAVA_HOME /usr/lib/jvm/java+ENV JAVA_OPTS -Xmx1024mENV MANAGER_DOCROOT webappENV CONSOLE_DOCROOT /deployment/consoles@@ -13,9 +14,11 @@ EXPOSE 8080HEALTHCHECK --interval=3s --timeout=3s --start-period=2s --retries=30 CMD curl --fail http://localhost:8080 || exit 1+RUN mkdir -p /deployment/extensions+WORKDIR /opt/appADD server /opt/appADD client /opt/app-ENTRYPOINT ["java", "-cp", "/opt/app/lib/*", "org.openremote.manager.server.Main"]+ENTRYPOINT java $JAVA_OPTS -cp /opt/app/lib/*:/deployment/extensions org.openremote.manager.server.Maindiff --git a/test/src/test/groovy/org/openremote/test/assets/AssetBrowserPresenterTest.groovy b/test/src/test/groovy/org/openremote/test/assets/AssetBrowserPresenterTest.groovyindex 521096640..b7106ec21 100644--- a/test/src/test/groovy/org/openremote/test/assets/AssetBrowserPresenterTest.groovy+++ b/test/src/test/groovy/org/openremote/test/assets/AssetBrowserPresenterTest.groovy@@ -68,7 +68,7 @@ class AssetBrowserPresenterTest extends Specification implements ManagerContaine).token}def securityService = new ClientSecurityService(keycloakProvider.getKeycloakDeployment(realm, KEYCLOAK_CLIENT_ID), accessToken)- def currentTenant = identityService.initIdentityProvider.getTenantForRealm(realm)+ def currentTenant = identityService.getIdentityProvider().getTenantForRealm(realm)and: "a client request service and target"def constraintViolationReader = new ClientObjectMapper(container.JSON, ConstraintViolationReport.class) as EntityReader<ConstraintViolationReport>@@ -238,7 +238,7 @@ class AssetBrowserPresenterTest extends Specification implements ManagerContaine1 * assetBrowser.refresh(asset.id, managerDemoSetup.smartOfficeId)cleanup: "the client should be stopped"- clientEventService.close()+ if (clientEventService != null) clientEventService.close()and: "the server should be stopped"stopContainer(container)@@ -267,7 +267,7 @@ class AssetBrowserPresenterTest extends Specification implements ManagerContaine).token}def securityService = new ClientSecurityService(keycloakProvider.getKeycloakDeployment(realm, KEYCLOAK_CLIENT_ID), accessToken)- def currentTenant = identityService.initIdentityProvider.getTenantForRealm(realm)+ def currentTenant = identityService.getIdentityProvider().getTenantForRealm(realm)and: "a client request service and target"def constraintViolationReader = new ClientObjectMapper(container.JSON, ConstraintViolationReport.class) as EntityReader<ConstraintViolationReport>@@ -419,7 +419,7 @@ class AssetBrowserPresenterTest extends Specification implements ManagerContaine}cleanup: "the client should be stopped"- clientEventService.close()+ if (clientEventService != null) clientEventService.close()and: "the server should be stopped"stopContainer(container)@@ -446,7 +446,7 @@ class AssetBrowserPresenterTest extends Specification implements ManagerContaine).token}def securityService = new ClientSecurityService(keycloakProvider.getKeycloakDeployment(realm, KEYCLOAK_CLIENT_ID), accessToken)- def currentTenant = identityService.initIdentityProvider.getTenantForRealm(realm)+ def currentTenant = identityService.getIdentityProvider().getTenantForRealm(realm)and: "a client request service and target"def constraintViolationReader = new ClientObjectMapper(container.JSON, ConstraintViolationReport.class) as EntityReader<ConstraintViolationReport>@@ -530,7 +530,7 @@ class AssetBrowserPresenterTest extends Specification implements ManagerContaine}cleanup: "the client should be stopped"- clientEventService.close()+ if (clientEventService != null) clientEventService.close()and: "the server should be stopped"stopContainer(container)diff --git a/test/src/test/groovy/org/openremote/test/assets/AssetUserLinkingTest.groovy b/test/src/test/groovy/org/openremote/test/assets/AssetUserLinkingTest.groovyindex 89d96976e..8a49d6f80 100644--- a/test/src/test/groovy/org/openremote/test/assets/AssetUserLinkingTest.groovy+++ b/test/src/test/groovy/org/openremote/test/assets/AssetUserLinkingTest.groovy@@ -43,9 +43,9 @@ class AssetUserLinkingTest extends Specification implements ManagerContainerTrai/* ############################################## READ ####################################### */expect: "some users to be restricted"- !identityService.initIdentityProvider.isRestrictedUser(keycloakDemoSetup.testuser1Id)- !identityService.initIdentityProvider.isRestrictedUser(keycloakDemoSetup.testuser2Id)- identityService.initIdentityProvider.isRestrictedUser(keycloakDemoSetup.testuser3Id)+ !identityService.getIdentityProvider().isRestrictedUser(keycloakDemoSetup.testuser1Id)+ !identityService.getIdentityProvider().isRestrictedUser(keycloakDemoSetup.testuser2Id)+ identityService.getIdentityProvider().isRestrictedUser(keycloakDemoSetup.testuser3Id)when: "all user assets are retrieved of a realm"def userAssets = assetResource.getUserAssetLinks(null, keycloakDemoSetup.customerATenant.id, null, null)@@ -147,7 +147,7 @@ class AssetUserLinkingTest extends Specification implements ManagerContainerTraiuserAssets = assetResource.getUserAssetLinks(null, keycloakDemoSetup.customerATenant.id, keycloakDemoSetup.testuser2Id, null)then: "result should match"- identityService.initIdentityProvider.isRestrictedUser(keycloakDemoSetup.testuser2Id)+ identityService.getIdentityProvider().isRestrictedUser(keycloakDemoSetup.testuser2Id)userAssets.length == 1userAssets.any {it.id.realmId == keycloakDemoSetup.customerATenant.id &&@@ -164,7 +164,7 @@ class AssetUserLinkingTest extends Specification implements ManagerContainerTraiuserAssets = assetResource.getUserAssetLinks(null, keycloakDemoSetup.customerATenant.id, keycloakDemoSetup.testuser2Id, null)then: "result should match"- !identityService.initIdentityProvider.isRestrictedUser(keycloakDemoSetup.testuser2Id)+ !identityService.getIdentityProvider().isRestrictedUser(keycloakDemoSetup.testuser2Id)userAssets.length == 0cleanup: "the server should be stopped"diff --git a/test/src/test/groovy/org/openremote/test/protocol/BasicProtocolTest.groovy b/test/src/test/groovy/org/openremote/test/protocol/BasicProtocolTest.groovyindex fc007b7d7..da753fb33 100644--- a/test/src/test/groovy/org/openremote/test/protocol/BasicProtocolTest.groovy+++ b/test/src/test/groovy/org/openremote/test/protocol/BasicProtocolTest.groovy@@ -441,7 +441,7 @@ class BasicProtocolTest extends Specification implements ManagerContainerTrait,}cleanup: "the client should be stopped"- clientEventService.close()+ if (clientEventService != null) clientEventService.close()and: "the server should be stopped"stopContainer(container)diff --git a/test/src/test/groovy/org/openremote/test/rules/BasicRulesDeploymentTest.groovy b/test/src/test/groovy/org/openremote/test/rules/BasicRulesDeploymentTest.groovyindex 613299c0c..5e8d62a2b 100644--- a/test/src/test/groovy/org/openremote/test/rules/BasicRulesDeploymentTest.groovy+++ b/test/src/test/groovy/org/openremote/test/rules/BasicRulesDeploymentTest.groovy@@ -210,7 +210,7 @@ class BasicRulesDeploymentTest extends Specification implements ManagerContainerdef apartment3Engine = rulesService.assetEngines.get(managerDemoSetup.apartment3Id)def customerATenant = keycloakDemoSetup.customerATenantcustomerATenant.setEnabled(false)- identityService.initIdentityProvider.updateTenant(new ClientRequestInfo(null, accessToken), customerATenant.getRealm(), customerATenant)+ identityService.getIdentityProvider().updateTenant(new ClientRequestInfo(null, accessToken), customerATenant.getRealm(), customerATenant)then: "the tenants rule engine should stop and all asset rule engines in this realm should also stop"conditions.eventually {@@ -236,7 +236,7 @@ class BasicRulesDeploymentTest extends Specification implements ManagerContainerwhen: "the disabled tenant is re-enabled"customerATenant.setEnabled(true)- identityService.initIdentityProvider.updateTenant(new ClientRequestInfo(null, accessToken), customerATenant.getRealm(), customerATenant)+ identityService.getIdentityProvider().updateTenant(new ClientRequestInfo(null, accessToken), customerATenant.getRealm(), customerATenant)then: "the tenants rule engine should start and all asset rule engines from this realm should also start"conditions.eventually {