Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix inconsistency with endpointWithAttributes test #2196

Merged
merged 8 commits into from Dec 21, 2022
Merged
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -282,9 +282,16 @@ class PinpointAnalyticsInstrumentationTest {
.customProperties(properties)
.userAttributes(userAttributes)
.build()
Amplify.Analytics.identifyUser(UUID.randomUUID().toString(), pinpointUserProfile)
val uuid = UUID.randomUUID().toString()
Amplify.Analytics.identifyUser(uuid, pinpointUserProfile)
Sleep.milliseconds(PINPOINT_ROUNDTRIP_TIMEOUT)
val endpointResponse = fetchEndpointResponse()
var endpointResponse = fetchEndpointResponse()
var retry_count = 0
while (retry_count < 10 && (endpointResponse.attributes == null || endpointResponse.attributes?.size == 0)) {
Sleep.milliseconds(5 * 1000L)
tjleing marked this conversation as resolved.
Show resolved Hide resolved
endpointResponse = fetchEndpointResponse()
retry_count++
}
assertCommonEndpointResponseProperties(endpointResponse)
Assert.assertEquals(
"User attribute value",
Expand All @@ -310,7 +317,7 @@ class PinpointAnalyticsInstrumentationTest {
}

private fun assertCommonEndpointResponseProperties(endpointResponse: EndpointResponse) {
Log.i("DEBUG", endpointResponse.toString())
Log.d("PinpointAnalyticsInstrumentationTest", endpointResponse.toString())
val attributes = endpointResponse.attributes!!
Assert.assertEquals("user@test.com", attributes["email"]!![0])
Assert.assertEquals("test-user", attributes["name"]!![0])
Expand Down