use of org.thingsboard.server.common.data.TenantProfile in project thingsboard by thingsboard.
the class BaseTenantProfileServiceTest method testSaveSameTenantProfileWithDifferentIsolatedTbRuleEngine.
@Test(expected = DataValidationException.class)
public void testSaveSameTenantProfileWithDifferentIsolatedTbRuleEngine() {
TenantProfile tenantProfile = this.createTenantProfile("Tenant Profile");
TenantProfile savedTenantProfile = tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile);
savedTenantProfile.setIsolatedTbRuleEngine(true);
tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, savedTenantProfile);
}
use of org.thingsboard.server.common.data.TenantProfile in project thingsboard by thingsboard.
the class BaseTenantProfileServiceTest method testDeleteTenantProfileWithExistingTenant.
@Test(expected = DataValidationException.class)
public void testDeleteTenantProfileWithExistingTenant() {
TenantProfile tenantProfile = this.createTenantProfile("Tenant Profile");
TenantProfile savedTenantProfile = tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile);
Tenant tenant = new Tenant();
tenant.setTitle("Test tenant");
tenant.setTenantProfileId(savedTenantProfile.getId());
tenant = tenantService.saveTenant(tenant);
try {
tenantProfileService.deleteTenantProfile(TenantId.SYS_TENANT_ID, savedTenantProfile.getId());
} finally {
tenantService.deleteTenant(tenant.getId());
}
}
use of org.thingsboard.server.common.data.TenantProfile in project thingsboard by thingsboard.
the class BaseTenantProfileServiceTest method testSaveTenantProfileWithSameName.
@Test(expected = DataValidationException.class)
public void testSaveTenantProfileWithSameName() {
TenantProfile tenantProfile = this.createTenantProfile("Tenant Profile");
tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile);
TenantProfile tenantProfile2 = this.createTenantProfile("Tenant Profile");
tenantProfileService.saveTenantProfile(TenantId.SYS_TENANT_ID, tenantProfile2);
}
use of org.thingsboard.server.common.data.TenantProfile in project thingsboard by thingsboard.
the class BaseDeviceServiceTest method testSaveDevicesWithInfiniteMaxDeviceLimit.
@Test
public void testSaveDevicesWithInfiniteMaxDeviceLimit() {
TenantProfile defaultTenantProfile = tenantProfileService.findDefaultTenantProfile(tenantId);
defaultTenantProfile.getProfileData().setConfiguration(DefaultTenantProfileConfiguration.builder().maxDevices(Long.MAX_VALUE).build());
tenantProfileService.saveTenantProfile(tenantId, defaultTenantProfile);
Device device = this.saveDevice(tenantId, "My device");
deleteDevice(tenantId, device);
}
use of org.thingsboard.server.common.data.TenantProfile in project thingsboard by thingsboard.
the class TenantProfileEntity method toData.
@Override
public TenantProfile toData() {
TenantProfile tenantProfile = new TenantProfile(new TenantProfileId(this.getUuid()));
tenantProfile.setCreatedTime(createdTime);
tenantProfile.setName(name);
tenantProfile.setDescription(description);
tenantProfile.setDefault(isDefault);
tenantProfile.setIsolatedTbCore(isolatedTbCore);
tenantProfile.setIsolatedTbRuleEngine(isolatedTbRuleEngine);
tenantProfile.setProfileData(JacksonUtil.convertValue(profileData, TenantProfileData.class));
return tenantProfile;
}
Aggregations