Search in sources :

Example 1 with TelemetryEntityView

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")));
}
Also used : Tenant(org.thingsboard.server.common.data.Tenant) User(org.thingsboard.server.common.data.User) AttributesEntityView(org.thingsboard.server.common.data.objects.AttributesEntityView) Device(org.thingsboard.server.common.data.Device) TelemetryEntityView(org.thingsboard.server.common.data.objects.TelemetryEntityView) Before(org.junit.Before)

Example 2 with TelemetryEntityView

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);
}
Also used : TelemetryEntityView(org.thingsboard.server.common.data.objects.TelemetryEntityView) EntityView(org.thingsboard.server.common.data.EntityView) TelemetryEntityView(org.thingsboard.server.common.data.objects.TelemetryEntityView)

Aggregations

TelemetryEntityView (org.thingsboard.server.common.data.objects.TelemetryEntityView)2 Before (org.junit.Before)1 Device (org.thingsboard.server.common.data.Device)1 EntityView (org.thingsboard.server.common.data.EntityView)1 Tenant (org.thingsboard.server.common.data.Tenant)1 User (org.thingsboard.server.common.data.User)1 AttributesEntityView (org.thingsboard.server.common.data.objects.AttributesEntityView)1