Search in sources :

Example 1 with SettingsData

use of com.google.firebase.crashlytics.internal.settings.model.SettingsData in project firebase-android-sdk by firebase.

the class SettingsJsonParserTest method testSettingsV2Parsing.

public void testSettingsV2Parsing() throws Exception {
    final JSONObject testJson = getTestJSON("default_settings.json");
    final SettingsData settingsData = settingsJsonParser.parseSettingsJson(testJson);
    Assert.assertEquals("http://localhost:3000/spi/v1/platform/android/apps", settingsData.appData.url);
    Assert.assertNull(settingsData.appData.organizationId);
    Assert.assertNull(settingsData.appData.bundleId);
}
Also used : SettingsData(com.google.firebase.crashlytics.internal.settings.model.SettingsData) JSONObject(org.json.JSONObject)

Example 2 with SettingsData

use of com.google.firebase.crashlytics.internal.settings.model.SettingsData in project firebase-android-sdk by firebase.

the class DefaultSettingsJsonTransformTest method testSettingsJsonTransformWithAnalyticsDefaults.

public void testSettingsJsonTransformWithAnalyticsDefaults() throws Exception {
    final JSONObject testJson = getTestJSON("default_settings_omitted.json");
    final SettingsData settingsData = transform.buildFromJson(mockCurrentTimeProvider, testJson);
    verifySettingsDataObject(mockCurrentTimeProvider, settingsData);
}
Also used : SessionSettingsData(com.google.firebase.crashlytics.internal.settings.model.SessionSettingsData) AppSettingsData(com.google.firebase.crashlytics.internal.settings.model.AppSettingsData) FeaturesSettingsData(com.google.firebase.crashlytics.internal.settings.model.FeaturesSettingsData) SettingsData(com.google.firebase.crashlytics.internal.settings.model.SettingsData) JSONObject(org.json.JSONObject)

Example 3 with SettingsData

use of com.google.firebase.crashlytics.internal.settings.model.SettingsData in project firebase-android-sdk by firebase.

the class DefaultSettingsJsonTransformTest method testNoIconJsonTransform.

public void testNoIconJsonTransform() throws Exception {
    final JSONObject testJson = getTestJSON("no_icon_settings.json");
    final SettingsData settingsData = transform.buildFromJson(mockCurrentTimeProvider, testJson);
    assertEquals(3600010, settingsData.expiresAtMillis);
    assertAppData(settingsData.appData);
    assertSettingsData(settingsData.sessionData);
    assertFeaturesData(settingsData.featuresData);
    verify(mockCurrentTimeProvider).getCurrentTimeMillis();
}
Also used : SessionSettingsData(com.google.firebase.crashlytics.internal.settings.model.SessionSettingsData) AppSettingsData(com.google.firebase.crashlytics.internal.settings.model.AppSettingsData) FeaturesSettingsData(com.google.firebase.crashlytics.internal.settings.model.FeaturesSettingsData) SettingsData(com.google.firebase.crashlytics.internal.settings.model.SettingsData) JSONObject(org.json.JSONObject)

Example 4 with SettingsData

use of com.google.firebase.crashlytics.internal.settings.model.SettingsData in project firebase-android-sdk by firebase.

the class DefaultSettingsJsonTransformTest method testSettingsJsonTransform.

public void testSettingsJsonTransform() throws Exception {
    when(mockCurrentTimeProvider.getCurrentTimeMillis()).thenReturn(Long.valueOf(10));
    final JSONObject testJson = getTestJSON("default_settings.json");
    final SettingsData settingsData = transform.buildFromJson(mockCurrentTimeProvider, testJson);
    verifySettingsDataObject(mockCurrentTimeProvider, settingsData);
}
Also used : SessionSettingsData(com.google.firebase.crashlytics.internal.settings.model.SessionSettingsData) AppSettingsData(com.google.firebase.crashlytics.internal.settings.model.AppSettingsData) FeaturesSettingsData(com.google.firebase.crashlytics.internal.settings.model.FeaturesSettingsData) SettingsData(com.google.firebase.crashlytics.internal.settings.model.SettingsData) JSONObject(org.json.JSONObject)

Example 5 with SettingsData

use of com.google.firebase.crashlytics.internal.settings.model.SettingsData in project firebase-android-sdk by firebase.

the class DefaultSettingsJsonTransformTest method testSettingsJsonTransformWithAnalyticsSampling.

public void testSettingsJsonTransformWithAnalyticsSampling() throws Exception {
    final JSONObject testJson = getTestJSON("settings_with_sampling.json");
    final SettingsData settingsData = transform.buildFromJson(mockCurrentTimeProvider, testJson);
    verifySettingsDataObject(mockCurrentTimeProvider, settingsData);
}
Also used : SessionSettingsData(com.google.firebase.crashlytics.internal.settings.model.SessionSettingsData) AppSettingsData(com.google.firebase.crashlytics.internal.settings.model.AppSettingsData) FeaturesSettingsData(com.google.firebase.crashlytics.internal.settings.model.FeaturesSettingsData) SettingsData(com.google.firebase.crashlytics.internal.settings.model.SettingsData) JSONObject(org.json.JSONObject)

Aggregations

SettingsData (com.google.firebase.crashlytics.internal.settings.model.SettingsData)19 AppSettingsData (com.google.firebase.crashlytics.internal.settings.model.AppSettingsData)18 FeaturesSettingsData (com.google.firebase.crashlytics.internal.settings.model.FeaturesSettingsData)15 SessionSettingsData (com.google.firebase.crashlytics.internal.settings.model.SessionSettingsData)15 JSONObject (org.json.JSONObject)15 JSONException (org.json.JSONException)3 Task (com.google.android.gms.tasks.Task)2 TaskCompletionSource (com.google.android.gms.tasks.TaskCompletionSource)2 NonNull (androidx.annotation.NonNull)1