fixed api test
This commit is contained in:
parent
3e0fad4a56
commit
f934863388
@ -77,7 +77,7 @@ public class ThingsboardSecurityConfiguration {
|
||||
public static final String FORM_BASED_LOGIN_ENTRY_POINT = "/api/auth/login";
|
||||
public static final String PUBLIC_LOGIN_ENTRY_POINT = "/api/auth/login/public";
|
||||
public static final String TOKEN_REFRESH_ENTRY_POINT = "/api/auth/token";
|
||||
protected static final String[] NON_TOKEN_BASED_AUTH_ENTRY_POINTS = new String[] {"/index.html", "/assets/**", "/static/**", "/api/noauth/**", "/webjars/**", "/api/license/**", "/api/images/public/**"};
|
||||
protected static final String[] NON_TOKEN_BASED_AUTH_ENTRY_POINTS = new String[] {"/index.html", "/assets/**", "/static/**", "/api/noauth/**", "/webjars/**", "/api/license/**", "/api/images/public/**", "/.well-known/**"};
|
||||
public static final String TOKEN_BASED_AUTH_ENTRY_POINT = "/api/**";
|
||||
public static final String WS_ENTRY_POINT = "/api/ws/**";
|
||||
public static final String MAIL_OAUTH2_PROCESSING_ENTRY_POINT = "/api/admin/mail/oauth2/code";
|
||||
|
||||
@ -125,7 +125,6 @@ public class MobileApplicationController extends BaseController {
|
||||
SecurityUser currentUser = getCurrentUser();
|
||||
accessControlService.checkPermission(currentUser, Resource.MOBILE_APP_SETTINGS, Operation.WRITE);
|
||||
mobileAppSettings.setTenantId(getTenantId());
|
||||
|
||||
return mobileAppSettingsService.saveMobileAppSettings(currentUser.getTenantId(), mobileAppSettings);
|
||||
}
|
||||
|
||||
@ -136,7 +135,6 @@ public class MobileApplicationController extends BaseController {
|
||||
public MobileAppSettings getMobileAppSettings() throws ThingsboardException {
|
||||
SecurityUser currentUser = getCurrentUser();
|
||||
accessControlService.checkPermission(currentUser, Resource.MOBILE_APP_SETTINGS, Operation.READ);
|
||||
|
||||
return mobileAppSettingsService.getMobileAppSettings(TenantId.SYS_TENANT_ID);
|
||||
}
|
||||
|
||||
|
||||
@ -163,6 +163,12 @@ public class MobileApplicationControllerTest extends AbstractControllerTest {
|
||||
|
||||
@Test
|
||||
public void testGetApplicationAssociations() throws Exception {
|
||||
loginSysAdmin();
|
||||
MobileAppSettings mobileAppSettings = doGet("/api/mobile/app/settings", MobileAppSettings.class);
|
||||
mobileAppSettings.setUseDefaultApp(false);
|
||||
doPost("/api/mobile/app/settings", mobileAppSettings)
|
||||
.andExpect(status().isOk());
|
||||
|
||||
JsonNode assetLinks = doGet("/.well-known/assetlinks.json", JsonNode.class);
|
||||
assertThat(assetLinks.get(0).get("target").get("package_name").asText()).isEqualTo(ANDROID_PACKAGE_NAME);
|
||||
assertThat(assetLinks.get(0).get("target").get("sha256_cert_fingerprints").get(0).asText()).isEqualTo(ANDROID_APP_SHA256);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user