diff --git a/application/src/main/java/org/thingsboard/server/service/entitiy/tenant/DefaultTbTenantService.java b/application/src/main/java/org/thingsboard/server/service/entitiy/tenant/DefaultTbTenantService.java index 33789537b9..99896ae2da 100644 --- a/application/src/main/java/org/thingsboard/server/service/entitiy/tenant/DefaultTbTenantService.java +++ b/application/src/main/java/org/thingsboard/server/service/entitiy/tenant/DefaultTbTenantService.java @@ -51,13 +51,11 @@ public Tenant save(Tenant tenant) throws Exception { Tenant oldTenant = !created ? tenantService.findTenantById(tenant.getId()) : null; Tenant savedTenant = checkNotNull(tenantService.saveTenant(tenant)); - /* edge: DefaultRuleChains and DefaultEdgeRuleChains are configured on Cloud if (created) { installScripts.createDefaultRuleChains(savedTenant.getId()); installScripts.createDefaultEdgeRuleChains(savedTenant.getId()); installScripts.createDefaultTenantDashboards(savedTenant.getId(), null); } - */ tenantProfileCache.evict(savedTenant.getId()); notificationEntityService.notifyCreateOrUpdateTenant(savedTenant, created ? ComponentLifecycleEvent.CREATED : ComponentLifecycleEvent.UPDATED); diff --git a/msa/edge-black-box-tests/src/test/java/org/thingsboard/server/msa/edge/AlarmClientTest.java b/msa/edge-black-box-tests/src/test/java/org/thingsboard/server/msa/edge/AlarmClientTest.java index 686143ca81..89a25aeefe 100644 --- a/msa/edge-black-box-tests/src/test/java/org/thingsboard/server/msa/edge/AlarmClientTest.java +++ b/msa/edge-black-box-tests/src/test/java/org/thingsboard/server/msa/edge/AlarmClientTest.java @@ -19,7 +19,6 @@ import lombok.extern.slf4j.Slf4j; import org.awaitility.Awaitility; import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.springframework.http.ResponseEntity; import org.thingsboard.common.util.JacksonUtil; @@ -56,8 +55,8 @@ public void testAlarms() throws Exception { JsonObject telemetry = new JsonObject(); telemetry.addProperty("temperature", 100); - ResponseEntity deviceTelemetryResponse = edgeRestClient.getRestTemplate() - .postForEntity(edgeUrl + "/api/v1/{credentialsId}/telemetry", + ResponseEntity deviceTelemetryResponse = cloudRestClient.getRestTemplate() + .postForEntity(tbUrl + "/api/v1/{credentialsId}/telemetry", JacksonUtil.OBJECT_MAPPER.readTree(telemetry.toString()), ResponseEntity.class, accessToken); @@ -132,8 +131,8 @@ public void sendAlarmToCloud() { JsonObject telemetry = new JsonObject(); telemetry.addProperty("temperature", 100); - ResponseEntity deviceTelemetryResponse = edgeRestClient.getRestTemplate() - .postForEntity(edgeUrl + "/api/v1/" + accessToken + "/telemetry", + ResponseEntity deviceTelemetryResponse = cloudRestClient.getRestTemplate() + .postForEntity(tbUrl + "/api/v1/" + accessToken + "/telemetry", JacksonUtil.toJsonNode(telemetry.toString()), ResponseEntity.class); Assert.assertTrue(deviceTelemetryResponse.getStatusCode().is2xxSuccessful());