use of org.thingsboard.server.common.data.objects.TelemetryEntityView in project thingsboard by thingsboard.
the class BaseEntityViewControllerTest method beforeTest.
@Before
public void beforeTest() throws Exception {
loginSysAdmin();
idComparator = new IdComparator<>();
savedTenant = doPost("/api/tenant", getNewTenant("My tenant"), Tenant.class);
Assert.assertNotNull(savedTenant);
tenantAdmin = new User();
tenantAdmin.setAuthority(Authority.TENANT_ADMIN);
tenantAdmin.setTenantId(savedTenant.getId());
tenantAdmin.setEmail("tenant2@thingsboard.org");
tenantAdmin.setFirstName("Joe");
tenantAdmin.setLastName("Downs");
tenantAdmin = createUserAndLogin(tenantAdmin, "testPassword1");
Device device = new Device();
device.setName("Test device");
device.setType("default");
testDevice = doPost("/api/device", device, Device.class);
telemetry = new TelemetryEntityView(Arrays.asList("tsKey1", "tsKey2", "tsKey3"), new AttributesEntityView(Arrays.asList("caKey1", "caKey2", "caKey3", "caKey4"), Arrays.asList("saKey1", "saKey2", "saKey3", "saKey4"), Arrays.asList("shKey1", "shKey2", "shKey3", "shKey4")));
}
use of org.thingsboard.server.common.data.objects.TelemetryEntityView in project thingsboard by thingsboard.
the class BaseTimeseriesServiceTest method saveAndCreateEntityView.
private EntityView saveAndCreateEntityView(DeviceId deviceId, List<String> timeseries) {
EntityView entityView = new EntityView();
entityView.setName("entity_view_name");
entityView.setType("default");
entityView.setTenantId(tenantId);
TelemetryEntityView keys = new TelemetryEntityView();
keys.setTimeseries(timeseries);
entityView.setKeys(keys);
entityView.setEntityId(deviceId);
return entityViewService.saveEntityView(entityView);
}
Aggregations