Skip to content

Commit

Permalink
Fix Edge tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiLandiak committed Jan 31, 2024
1 parent 9560f22 commit ae0c5e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit ae0c5e8

Please sign in to comment.