Browse Source
Merge pull request #16348 from smatvienko-tb/fix/flaky-qr-code-deep-link
Fixed flaky QrCodeSettingsControllerTest deep link test caused by leaked system base URL
pull/16361/head
Viacheslav Klimov
2 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
7 additions and
2 deletions
-
application/src/test/java/org/thingsboard/server/controller/QrCodeSettingsControllerTest.java
-
application/src/test/java/org/thingsboard/server/controller/WhiteLabelingControllerTest.java
|
|
|
@ -53,7 +53,8 @@ public class QrCodeSettingsControllerTest extends AbstractControllerTest { |
|
|
|
|
|
|
|
@Before |
|
|
|
public void setUp() throws Exception { |
|
|
|
loginSysAdmin(); |
|
|
|
// Deep link host is derived from the login white-labeling base URL; start from system defaults
|
|
|
|
resetSysAdminWhiteLabelingSettings(); |
|
|
|
|
|
|
|
MobileApp androidApp = validMobileApp( "my.android.package", PlatformType.ANDROID); |
|
|
|
StoreInfo androidStoreInfo = StoreInfo.builder() |
|
|
|
|
|
|
|
@ -36,7 +36,11 @@ public class WhiteLabelingControllerTest extends AbstractControllerTest { |
|
|
|
WhiteLabelingDao whiteLabelingDao; |
|
|
|
|
|
|
|
@After |
|
|
|
public void afterTest() { |
|
|
|
public void afterTest() throws Exception { |
|
|
|
// System-level login/white-labeling params are shared by every test class in the same DB;
|
|
|
|
// restore defaults so the base URL set here (e.g. "https://domain.com") does not leak.
|
|
|
|
resetSysAdminWhiteLabelingSettings(); |
|
|
|
|
|
|
|
if (tenantId != null) { |
|
|
|
WhiteLabelingCompositeKey key = new WhiteLabelingCompositeKey(tenantId, WhiteLabelingType.MAIL_TEMPLATES); |
|
|
|
if (whiteLabelingDao.findById(SYS_TENANT_ID, key) != null) { |
|
|
|
|