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

[UID2-2022] Add tests for opt out status API #36

Merged
merged 4 commits into from
Jun 12, 2024

Conversation

asloobq
Copy link
Contributor

@asloobq asloobq commented Jun 3, 2024

No description provided.

assertThat(optedOutRecord.has(TestData.OPTED_OUT_SINCE)).isTrue();
long optedOutSince = optedOutRecord.get(TestData.OPTED_OUT_SINCE).asLong();
// TODO uncomment after Opt Out Status API returns timestamp in milliseconds
// assertThat(optedOutSince).isGreaterThanOrEqualTo(optedOutTimestamp);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you wanna fix the timestamp first before merging this? Or just treat the timestamp as seconds and do optedOutSince*1000 (i think) in this MR and merge it first and once you fix the timestamp you fix this test again?

Copy link
Contributor Author

@asloobq asloobq Jun 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll fix the timestamp first and then merge this. Less likely this code changes in the next few days and cause merge conflicts. Will save me additional work to come back and fix the test

@@ -151,10 +170,56 @@ public void testV2TokenRefreshAfterOptOut(String label, Operator operator, Strin
with().pollInterval(5, TimeUnit.SECONDS).await("Get V2 Token Response").atMost(OPTOUT_WAIT_SECONDS, TimeUnit.SECONDS).until(() -> operator.v2TokenRefresh(refreshToken, refreshResponseKey).equals(Mapper.OBJECT_MAPPER.readTree("{\"status\":\"optout\"}")));
}

@Order(9)
@ParameterizedTest(name = "/v2/optout/status after v2/identity/map and v2/token/logout - DII {0} - expecting {4} - {2}")
@MethodSource({"afterOptoutAdvertisingIdArgs"})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify: this is getting updated by running previous tests first - specifically testV2LogoutWithV2IdentityMap()

Can't the assertions here be applied to existing tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you suggesting I merge the two tests ? Yes I can merge them. Having separate tests has the advantage that the test needs to wait for less time for the opt out data to flow through, since there are other methods which run before it.
Do you see any benefit in merging them ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope that makes sense, thanks for the clarification

@@ -151,10 +171,55 @@ public void testV2TokenRefreshAfterOptOut(String label, Operator operator, Strin
with().pollInterval(5, TimeUnit.SECONDS).await("Get V2 Token Response").atMost(OPTOUT_WAIT_SECONDS, TimeUnit.SECONDS).until(() -> operator.v2TokenRefresh(refreshToken, refreshResponseKey).equals(Mapper.OBJECT_MAPPER.readTree("{\"status\":\"optout\"}")));
}

@Order(9)
@ParameterizedTest(name = "/v2/optout/status after v2/identity/map and v2/token/logout - DII {0} - expecting {4} - {2}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can change the {0} in the other tests to DII {0} as well?

@asloobq asloobq merged commit e230b21 into main Jun 12, 2024
4 checks passed
@asloobq asloobq deleted the aaq-UID2-2022-opt-out-status-api branch June 12, 2024 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants