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
parent
commit
aef680bb9e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      application/src/test/java/org/thingsboard/server/controller/QrCodeSettingsControllerTest.java
  2. 6
      application/src/test/java/org/thingsboard/server/controller/WhiteLabelingControllerTest.java

3
application/src/test/java/org/thingsboard/server/controller/QrCodeSettingsControllerTest.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()

6
application/src/test/java/org/thingsboard/server/controller/WhiteLabelingControllerTest.java

@ -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) {

Loading…
Cancel
Save