Browse Source

Merge pull request #6736 from ViacheslavKlimov/vc-improvements

VC tests refactoring
pull/6759/head
Andrew Shvayka 4 years ago
committed by GitHub
parent
commit
72944d8a1f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      application/src/main/java/org/thingsboard/server/service/security/auth/mfa/provider/impl/SmsTwoFaProvider.java
  2. 9
      application/src/test/java/org/thingsboard/server/service/sync/ie/ExportImportServiceSqlTest.java

2
application/src/main/java/org/thingsboard/server/service/security/auth/mfa/provider/impl/SmsTwoFaProvider.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);
}
}

9
application/src/test/java/org/thingsboard/server/service/sync/ie/ExportImportServiceSqlTest.java

@ -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);
}
}

Loading…
Cancel
Save