@ApiOperation(value = "Create Or Update the Mobile application settings (saveMobileAppSettings)",
            notes = "The request payload contains configuration for android/iOS applications and platform qr code widget settings." + SYSTEM_AUTHORITY_PARAGRAPH)
    @PreAuthorize("hasAnyAuthority('SYS_ADMIN')")
    @PostMapping(value = "/api/mobile/app/settings")
    public MobileAppSettings saveMobileAppSettings(@Parameter(description = "A JSON value representing the mobile apps configuration")
                                                   @RequestBody MobileAppSettings mobileAppSettings) throws ThingsboardException {
        SecurityUser currentUser = getCurrentUser();
        accessControlService.checkPermission(currentUser, Resource.MOBILE_APP_SETTINGS, Operation.WRITE);
        mobileAppSettings.setTenantId(getTenantId());
        return mobileAppSettingsService.saveMobileAppSettings(currentUser.getTenantId(), mobileAppSettings);
    }
@Test
    public void testSaveMobileAppSettings() throws Exception {
        loginSysAdmin();
        MobileAppSettings mobileAppSettings = doGet("/api/mobile/app/settings", MobileAppSettings.class);
        assertThat(mobileAppSettings.getQrCodeConfig().getQrCodeLabel()).isEqualTo(TEST_LABEL);
        assertThat(mobileAppSettings.isUseDefaultApp()).isTrue();

        mobileAppSettings.setUseDefaultApp(false);

        doPost("/api/mobile/app/settings", mobileAppSettings)
                .andExpect(status().isOk());

        MobileAppSettings updatedMobileAppSettings = doGet("/api/mobile/app/settings", MobileAppSettings.class);
        assertThat(updatedMobileAppSettings.isUseDefaultApp()).isFalse();
    }