Skip to content

Commit

Permalink
Reset developerMode status when Datadog stop
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusc83 committed Aug 8, 2024
1 parent 5536f75 commit 08f3cb8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ internal class DatadogCore(

/** @inheritDoc */
override var isDeveloperModeEnabled: Boolean = false
private set
internal set

/** @inheritDoc */
override fun registerFeature(feature: Feature) {
Expand Down Expand Up @@ -545,6 +545,7 @@ internal class DatadogCore(
}

coreFeature.stop()
isDeveloperModeEnabled = false

removeShutdownHook()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,20 @@ internal class DatadogCoreTest {
assertThat(testedCore.features).isEmpty()
}

@Test
fun `M reset developer mode when stop()`(
@StringForgery fakeFeatureNames: Set<String>
) {
// Given
testedCore.isDeveloperModeEnabled = true

// When
testedCore.stop()

// Then
assertThat(testedCore.isDeveloperModeEnabled).isFalse()
}

@Test
fun `M unregister process lifecycle monitor W stop()`() {
// Given
Expand Down

0 comments on commit 08f3cb8

Please sign in to comment.