diff --git a/aws-pinpoint-core/src/test/java/com/amplifyframework/pinpoint/core/TargetingClientTest.kt b/aws-pinpoint-core/src/test/java/com/amplifyframework/pinpoint/core/TargetingClientTest.kt index 0c48e88a88..67199aa9f7 100644 --- a/aws-pinpoint-core/src/test/java/com/amplifyframework/pinpoint/core/TargetingClientTest.kt +++ b/aws-pinpoint-core/src/test/java/com/amplifyframework/pinpoint/core/TargetingClientTest.kt @@ -48,6 +48,15 @@ class TargetingClientTest { targetingClient = constructTargetingClient() } + @Test + fun testCurrentEndpoint() { + targetingClient.addAttribute("attribute", listOf("a", "b", "c")) + targetingClient.addMetric("metric", 2.0) + val endpoint = targetingClient.currentEndpoint() + assertEquals(endpoint.getAttribute("attribute"), listOf("a", "b", "c")) + assertEquals(endpoint.getMetric("metric"), 2.0) + } + @Test fun testUpdateEndpointProfile() = runTest { setup() @@ -56,6 +65,9 @@ class TargetingClientTest { val expectedToken = "token123" every { store.get(TargetingClient.AWS_PINPOINT_PUSHNOTIFICATIONS_DEVICE_TOKEN_KEY) } returns expectedToken + targetingClient.addAttribute("attribute", listOf("a1", "a2")) + targetingClient.addMetric("metric", 1.0) + val updateEndpointResponse = UpdateEndpointResponse.invoke {} coEvery { pinpointClient.updateEndpoint(ofType(UpdateEndpointRequest::class)) }.returns(updateEndpointResponse) targetingClient.updateEndpointProfile()