Skip to content

Commit d22b04c

Browse files
authored
fix(push): Add previously removed tests (#2589)
1 parent 3e5e869 commit d22b04c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

aws-pinpoint-core/src/test/java/com/amplifyframework/pinpoint/core/TargetingClientTest.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ class TargetingClientTest {
4848
targetingClient = constructTargetingClient()
4949
}
5050

51+
@Test
52+
fun testCurrentEndpoint() {
53+
targetingClient.addAttribute("attribute", listOf("a", "b", "c"))
54+
targetingClient.addMetric("metric", 2.0)
55+
val endpoint = targetingClient.currentEndpoint()
56+
assertEquals(endpoint.getAttribute("attribute"), listOf("a", "b", "c"))
57+
assertEquals(endpoint.getMetric("metric"), 2.0)
58+
}
59+
5160
@Test
5261
fun testUpdateEndpointProfile() = runTest {
5362
setup()
@@ -56,6 +65,9 @@ class TargetingClientTest {
5665
val expectedToken = "token123"
5766
every { store.get(TargetingClient.AWS_PINPOINT_PUSHNOTIFICATIONS_DEVICE_TOKEN_KEY) } returns expectedToken
5867

68+
targetingClient.addAttribute("attribute", listOf("a1", "a2"))
69+
targetingClient.addMetric("metric", 1.0)
70+
5971
val updateEndpointResponse = UpdateEndpointResponse.invoke {}
6072
coEvery { pinpointClient.updateEndpoint(ofType(UpdateEndpointRequest::class)) }.returns(updateEndpointResponse)
6173
targetingClient.updateEndpointProfile()

0 commit comments

Comments
 (0)