@@ -38,7 +38,7 @@ public void identityMapEmails() {
3838 response .assertMapped (mappedEmail );
3939 response .assertMapped (optedOutEmail2 );
4040
41- response .assertUnmapped (" OPTOUT" , optedOutEmail );
41+ response .assertUnmapped (UnmappedIdentityReason . OPTOUT , optedOutEmail );
4242 }
4343
4444 @ Test
@@ -55,7 +55,7 @@ public void identityMapNothingMapped() {
5555 IdentityMapV3Input identityMapInput = IdentityMapV3Input .fromEmails (Collections .singletonList (optedOutEmail ));
5656 Response response = new Response (identityMapInput );
5757
58- response .assertUnmapped (" OPTOUT" , optedOutEmail );
58+ response .assertUnmapped (UnmappedIdentityReason . OPTOUT , optedOutEmail );
5959 }
6060
6161
@@ -77,15 +77,15 @@ public void identityMapInvalidHashedEmail() {
7777
7878 Response response = new Response (identityMapInput );
7979
80- response .assertUnmapped (" INVALID" , "this is not a hashed email" );
80+ response .assertUnmapped (UnmappedIdentityReason . INVALID , "this is not a hashed email" );
8181 }
8282
8383 @ Test
8484 public void identityMapInvalidHashedPhone () {
8585 IdentityMapV3Input identityMapInput = IdentityMapV3Input .fromHashedPhones (Collections .singletonList ("this is not a hashed phone" ));
8686
8787 Response response = new Response (identityMapInput );
88- response .assertUnmapped (" INVALID" , "this is not a hashed phone" );
88+ response .assertUnmapped (UnmappedIdentityReason . INVALID , "this is not a hashed phone" );
8989 }
9090
9191 @ Test
@@ -100,7 +100,7 @@ public void identityMapHashedEmails() {
100100 response .assertMapped (hashedEmail1 );
101101 response .assertMapped (hashedEmail2 );
102102
103- response .assertUnmapped (" OPTOUT" , hashedOptedOutEmail );
103+ response .assertUnmapped (UnmappedIdentityReason . OPTOUT , hashedOptedOutEmail );
104104 }
105105
106106 @ Test
@@ -125,7 +125,7 @@ public void identityMapDuplicateHashedEmails() {
125125
126126 response .assertMapped (mappedEmailHash );
127127
128- response .assertUnmapped (" OPTOUT" , optedOutEmailHash );
128+ response .assertUnmapped (UnmappedIdentityReason . OPTOUT , optedOutEmailHash );
129129 }
130130
131131 @ Test
@@ -145,7 +145,7 @@ public void identityMapPhones() {
145145 response .assertMapped (mappedPhone );
146146 response .assertMapped (mappedPhone2 );
147147
148- response .assertUnmapped (" OPTOUT" , optedOutPhone );
148+ response .assertUnmapped (UnmappedIdentityReason . OPTOUT , optedOutPhone );
149149 }
150150
151151 @ Test
@@ -160,7 +160,7 @@ public void identityMapHashedPhones() {
160160 response .assertMapped (hashedPhone1 );
161161 response .assertMapped (hashedPhone2 );
162162
163- response .assertUnmapped (" OPTOUT" , hashedOptedOutPhone );
163+ response .assertUnmapped (UnmappedIdentityReason . OPTOUT , hashedOptedOutPhone );
164164 }
165165
166166 @ Test
@@ -178,10 +178,10 @@ public void identityMapAllIdentityTypesInOneRequest() {
178178 response .assertMapped (mappedPhone );
179179 response .assertMapped (mappedPhoneHash );
180180
181- response .assertUnmapped (" OPTOUT" , optedOutEmail );
182- response .assertUnmapped (" OPTOUT" , optedOutEmailHash );
183- response .assertUnmapped (" OPTOUT" , optedOutPhone );
184- response .assertUnmapped (" OPTOUT" , optedOutPhoneHash );
181+ response .assertUnmapped (UnmappedIdentityReason . OPTOUT , optedOutEmail );
182+ response .assertUnmapped (UnmappedIdentityReason . OPTOUT , optedOutEmailHash );
183+ response .assertUnmapped (UnmappedIdentityReason . OPTOUT , optedOutPhone );
184+ response .assertUnmapped (UnmappedIdentityReason . OPTOUT , optedOutPhoneHash );
185185 }
186186
187187 @ Test
@@ -198,8 +198,8 @@ public void identityMapAllIdentityTypesInOneRequestAddedOneByOne() {
198198 response .assertMapped (mappedEmail );
199199 response .assertMapped (mappedPhoneHash );
200200
201- response .assertUnmapped (" OPTOUT" , optedOutPhone );
202- response .assertUnmapped (" OPTOUT" , optedOutEmailHash );
201+ response .assertUnmapped (UnmappedIdentityReason . OPTOUT , optedOutPhone );
202+ response .assertUnmapped (UnmappedIdentityReason . OPTOUT , optedOutEmailHash );
203203 }
204204
205205
@@ -217,14 +217,14 @@ void assertMapped(String dii) {
217217 Instant aMinuteAgo = Instant .now ().minusSeconds (60 );
218218 assertTrue (mappedIdentity .getRefreshFrom ().isAfter (aMinuteAgo ));
219219
220- IdentityMapV3Response . UnmappedIdentity unmappedIdentity = identityMapResponse .getUnmappedIdentities ().get (dii );
221- assertNull (unmappedIdentity );
220+ UnmappedIdentityReason unmappedIdentityReason = identityMapResponse .getUnmappedIdentities ().get (dii );
221+ assertNull (unmappedIdentityReason );
222222 }
223223
224- void assertUnmapped (String reason , String dii ) {
225- HashMap <String , IdentityMapV3Response . UnmappedIdentity > unmappedIdentities = identityMapResponse .getUnmappedIdentities ();
226- IdentityMapV3Response . UnmappedIdentity dii2 = unmappedIdentities .get (dii );
227- assertEquals (reason , dii2 . getReason () );
224+ void assertUnmapped (UnmappedIdentityReason reason , String dii ) {
225+ HashMap <String , UnmappedIdentityReason > unmappedIdentities = identityMapResponse .getUnmappedIdentities ();
226+ UnmappedIdentityReason dii2 = unmappedIdentities .get (dii );
227+ assertEquals (reason , dii2 );
228228
229229 IdentityMapV3Response .MappedIdentity mappedIdentity = identityMapResponse .getMappedIdentities ().get (dii );
230230 assertNull (mappedIdentity );
0 commit comments