-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"}) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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}") |
There was a problem hiding this comment.
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?
No description provided.