@@ -111,10 +111,10 @@ public void identityMapDuplicateEmails() {
111111 HashMap <String , IdentityMapV3Response .MappedIdentity > mappedIdentities = identityMapResponse .getMappedIdentities ();
112112 assertEquals (4 , mappedIdentities .size ()); //it's not 5 because the last email is an exact match to the first email
113113
114- String rawUid =
mappedIdentities .
get (
"[email protected] " ).
getCurrentUid ();
115- assertEquals (
rawUid ,
mappedIdentities .
get (
"[email protected] " ).
getCurrentUid ());
116- assertEquals (
rawUid ,
mappedIdentities .
get (
"[email protected] " ).
getCurrentUid ());
117- assertEquals (
rawUid ,
mappedIdentities .
get (
"[email protected] " ).
getCurrentUid ());
114+ String rawUid =
mappedIdentities .
get (
"[email protected] " ).
getCurrentRawUid ();
115+ assertEquals (
rawUid ,
mappedIdentities .
get (
"[email protected] " ).
getCurrentRawUid ());
116+ assertEquals (
rawUid ,
mappedIdentities .
get (
"[email protected] " ).
getCurrentRawUid ());
117+ assertEquals (
rawUid ,
mappedIdentities .
get (
"[email protected] " ).
getCurrentRawUid ());
118118 }
119119
120120
@@ -211,8 +211,11 @@ class Response {
211211 void assertMapped (String dii ) {
212212 IdentityMapV3Response .MappedIdentity mappedIdentity = identityMapResponse .getMappedIdentities ().get (dii );
213213 assertNotNull (mappedIdentity );
214- assertFalse (mappedIdentity .getCurrentUid ().isEmpty ());
215- assertTrue (mappedIdentity .getRefreshFromSeconds () > Instant .now ().minusSeconds (24 * 60 * 60 ).getEpochSecond ());
214+ assertFalse (mappedIdentity .getCurrentRawUid ().isEmpty ());
215+
216+ // Refresh from should be now or in the future, allow some slack for time between request and this assertion
217+ Instant aMinuteAgo = Instant .now ().minusSeconds (60 );
218+ assertTrue (mappedIdentity .getRefreshFrom ().isAfter (aMinuteAgo ));
216219
217220 IdentityMapV3Response .UnmappedIdentity unmappedIdentity = identityMapResponse .getUnmappedIdentities ().get (dii );
218221 assertNull (unmappedIdentity );
@@ -254,7 +257,7 @@ public void identityMapEmailsUseOwnHttp() {
254257 IdentityMapV3Response identityMapResponse = identityMapHelper .createIdentityMapResponse (responseString , envelopeV2 , identityMapInput );
255258
256259 IdentityMapV3Response .MappedIdentity mappedIdentity = identityMapResponse .getMappedIdentities ().get (mappedEmail );
257- assertFalse (mappedIdentity .getCurrentUid ().isEmpty ());
260+ assertFalse (mappedIdentity .getCurrentRawUid ().isEmpty ());
258261 } catch (IOException e ) {
259262 throw new Uid2Exception ("error communicating with api endpoint" , e );
260263 }
0 commit comments