Browse Source
Merge pull request #6736 from ViacheslavKlimov/vc-improvements
VC tests refactoring
pull/6759/head
Andrew Shvayka
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
10 additions and
1 deletions
-
application/src/main/java/org/thingsboard/server/service/security/auth/mfa/provider/impl/SmsTwoFaProvider.java
-
application/src/test/java/org/thingsboard/server/service/sync/ie/ExportImportServiceSqlTest.java
|
|
|
@ -63,7 +63,7 @@ public class SmsTwoFaProvider extends OtpBasedTwoFaProvider<SmsTwoFaProviderConf |
|
|
|
@Override |
|
|
|
public void check(TenantId tenantId) throws ThingsboardException { |
|
|
|
if (!smsService.isConfigured(tenantId)) { |
|
|
|
throw new ThingsboardException("SMS service in not configured", ThingsboardErrorCode.BAD_REQUEST_PARAMS); |
|
|
|
throw new ThingsboardException("SMS service is not configured", ThingsboardErrorCode.BAD_REQUEST_PARAMS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -559,6 +559,9 @@ public class ExportImportServiceSqlTest extends BaseExportImportServiceTest { |
|
|
|
assertThat(exportedDashboard.getAssignedCustomers()).hasOnlyOneElementSatisfying(shortCustomerInfo -> { |
|
|
|
assertThat(shortCustomerInfo.getCustomerId()).isEqualTo(customer.getId()); |
|
|
|
}); |
|
|
|
String exportedEntityAliasAssetId = exportedDashboard.getConfiguration().get("entityAliases").elements().next() |
|
|
|
.get("filter").get("entityList").elements().next().asText(); |
|
|
|
assertThat(exportedEntityAliasAssetId).isEqualTo(asset.getId().toString()); |
|
|
|
|
|
|
|
DeviceProfile exportedDeviceProfile = (DeviceProfile) exportEntity(tenantAdmin2, (DeviceProfileId) ids.get(deviceProfile.getId())).getEntity(); |
|
|
|
assertThat(exportedDeviceProfile.getDefaultRuleChainId()).isEqualTo(ruleChain.getId()); |
|
|
|
@ -571,6 +574,12 @@ public class ExportImportServiceSqlTest extends BaseExportImportServiceTest { |
|
|
|
EntityView exportedEntityView = (EntityView) exportEntity(tenantAdmin2, (EntityViewId) ids.get(entityView.getId())).getEntity(); |
|
|
|
assertThat(exportedEntityView.getCustomerId()).isEqualTo(customer.getId()); |
|
|
|
assertThat(exportedEntityView.getEntityId()).isEqualTo(device.getId()); |
|
|
|
|
|
|
|
deviceProfile.setDefaultDashboardId(null); |
|
|
|
deviceProfileService.saveDeviceProfile(deviceProfile); |
|
|
|
DeviceProfile importedDeviceProfile = deviceProfileService.findDeviceProfileById(tenantId2, (DeviceProfileId) ids.get(deviceProfile.getId())); |
|
|
|
importedDeviceProfile.setDefaultDashboardId(null); |
|
|
|
deviceProfileService.saveDeviceProfile(importedDeviceProfile); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|