Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markushi committed Jun 29, 2023
1 parent 4ced6e2 commit c0b0727
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public final class SentryAndroidOptions extends SentryOptions {
* Enable the Java to NDK Scope sync. The default value for sentry-java is disabled and enabled
* for sentry-android.
*/
private boolean enableScopeSync;
private boolean enableScopeSync = true;

public interface BeforeCaptureCallback {

Expand Down Expand Up @@ -195,9 +195,6 @@ public SentryAndroidOptions() {
setSentryClientName(BuildConfig.SENTRY_ANDROID_SDK_NAME + "/" + BuildConfig.VERSION_NAME);
setSdkVersion(createSdkVersion());
setAttachServerName(false);

// enable scope sync for Android by default
setEnableScopeSync(true);
}

private @NotNull SdkVersion createSdkVersion() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,16 @@ class SentryAndroidOptionsTest {
}

@Test
fun `when options is initialized, enableScopeSync is false`() {
assertFalse(SentryAndroidOptions().isEnableScopeSync)
fun `when options is initialized, enableScopeSync is enabled by default`() {
assertTrue(SentryAndroidOptions().isEnableScopeSync)
}

@Test
fun `enableScopeSync can be properly disabled`() {
val options = SentryAndroidOptions()
options.isEnableScopeSync = false

assertFalse(options.isEnableScopeSync)
}

private class CustomDebugImagesLoader : IDebugImagesLoader {
Expand Down

0 comments on commit c0b0727

Please sign in to comment.