@@ -122,28 +122,6 @@ class SdkCoreTest : MockServerTest() {
122
122
.containsExactlyInAnyOrderEntriesOf(fakeUserAdditionalProperties)
123
123
}
124
124
125
- @Test
126
- fun must_clearUserInformation_when_clearUserInfo () {
127
- // Given
128
- testedSdkCore?.setUserInfo(fakeUserId, fakeUserName, fakeUserEmail, fakeUserAdditionalProperties)
129
-
130
- // When
131
- testedSdkCore?.clearUserInfo()
132
-
133
- // Then
134
- val countDownLatch = CountDownLatch (1 )
135
- var readUserInfo: UserInfo ? = null
136
- featureSdkCore?.getFeature(stubFeature.name)?.withWriteContext { datadogContext, _ ->
137
- readUserInfo = datadogContext.userInfo
138
- countDownLatch.countDown()
139
- }
140
- countDownLatch.await(SHORT_WAIT_MS , TimeUnit .MILLISECONDS )
141
- assertThat(readUserInfo?.id).isNull()
142
- assertThat(readUserInfo?.name).isNull()
143
- assertThat(readUserInfo?.email).isNull()
144
- assertThat(readUserInfo?.additionalProperties).isEmpty()
145
- }
146
-
147
125
// endregion
148
126
149
127
// region set AccountInfo
@@ -208,6 +186,29 @@ class SdkCoreTest : MockServerTest() {
208
186
.containsExactlyInAnyOrderEntriesOf(fakeUserAdditionalProperties + expectedUserExtraProperties)
209
187
}
210
188
189
+ @Test
190
+ fun must_clearUserInformation_when_clearUserInfo () {
191
+ // Given
192
+ testedSdkCore.setUserInfo(fakeUserId, fakeUserName, fakeUserEmail, fakeUserAdditionalProperties)
193
+
194
+ // When
195
+ testedSdkCore.clearUserInfo()
196
+
197
+ // Then
198
+ val countDownLatch = CountDownLatch (1 )
199
+ var readUserInfo: UserInfo ? = null
200
+ featureSdkCore.getFeature(stubFeature.name)?.withWriteContext { datadogContext, _ ->
201
+ readUserInfo = datadogContext.userInfo
202
+ countDownLatch.countDown()
203
+ }
204
+ countDownLatch.await(SHORT_WAIT_MS , TimeUnit .MILLISECONDS )
205
+ assertThat(readUserInfo).isNotNull()
206
+ assertThat(readUserInfo?.id).isNull()
207
+ assertThat(readUserInfo?.name).isNull()
208
+ assertThat(readUserInfo?.email).isNull()
209
+ assertThat(readUserInfo?.additionalProperties).isEmpty()
210
+ }
211
+
211
212
@Test
212
213
fun must_useImmutableProperties_when_setUserProperties_attributesValuesModified () {
213
214
// Given
0 commit comments