@@ -1140,9 +1140,6 @@ public void testExportGrants() throws IOException, ParseException {
1140
1140
Date creationDate1 = formatter .parse ("2014-09-10T22:49:44.090+0000" , Locale .ENGLISH );
1141
1141
Date accessDate1 = formatter .parse ("2014-09-10T23:49:44.090+0000" , Locale .ENGLISH );
1142
1142
1143
- WhitelistedSite mockWlSite1 = mock (WhitelistedSite .class );
1144
- when (mockWlSite1 .getId ()).thenReturn (1L );
1145
-
1146
1143
OAuth2AccessTokenEntity mockToken1 = mock (OAuth2AccessTokenEntity .class );
1147
1144
when (mockToken1 .getId ()).thenReturn (1L );
1148
1145
@@ -1152,7 +1149,6 @@ public void testExportGrants() throws IOException, ParseException {
1152
1149
site1 .setCreationDate (creationDate1 );
1153
1150
site1 .setAccessDate (accessDate1 );
1154
1151
site1 .setUserId ("user1" );
1155
- site1 .setWhitelistedSite (mockWlSite1 );
1156
1152
site1 .setAllowedScopes (ImmutableSet .of ("openid" , "phone" ));
1157
1153
site1 .setApprovedAccessTokens (ImmutableSet .of (mockToken1 ));
1158
1154
@@ -1247,11 +1243,6 @@ public void testExportGrants() throws IOException, ParseException {
1247
1243
}
1248
1244
assertThat (site .get ("userId" ).getAsString (), equalTo (compare .getUserId ()));
1249
1245
assertThat (jsonArrayToStringSet (site .getAsJsonArray ("allowedScopes" )), equalTo (compare .getAllowedScopes ()));
1250
- if (site .get ("whitelistedSiteId" ).isJsonNull ()) {
1251
- assertNull (compare .getWhitelistedSite ());
1252
- } else {
1253
- assertThat (site .get ("whitelistedSiteId" ).getAsLong (), equalTo (compare .getWhitelistedSite ().getId ()));
1254
- }
1255
1246
if (site .get ("approvedAccessTokens" ).isJsonNull () || site .getAsJsonArray ("approvedAccessTokens" ) == null ) {
1256
1247
assertTrue (compare .getApprovedAccessTokens () == null || compare .getApprovedAccessTokens ().isEmpty ());
1257
1248
} else {
@@ -1274,9 +1265,6 @@ public void testImportGrants() throws IOException, ParseException {
1274
1265
Date creationDate1 = formatter .parse ("2014-09-10T22:49:44.090+0000" , Locale .ENGLISH );
1275
1266
Date accessDate1 = formatter .parse ("2014-09-10T23:49:44.090+0000" , Locale .ENGLISH );
1276
1267
1277
- WhitelistedSite mockWlSite1 = mock (WhitelistedSite .class );
1278
- when (mockWlSite1 .getId ()).thenReturn (1L );
1279
-
1280
1268
OAuth2AccessTokenEntity mockToken1 = mock (OAuth2AccessTokenEntity .class );
1281
1269
when (mockToken1 .getId ()).thenReturn (1L );
1282
1270
@@ -1286,7 +1274,6 @@ public void testImportGrants() throws IOException, ParseException {
1286
1274
site1 .setCreationDate (creationDate1 );
1287
1275
site1 .setAccessDate (accessDate1 );
1288
1276
site1 .setUserId ("user1" );
1289
- site1 .setWhitelistedSite (mockWlSite1 );
1290
1277
site1 .setAllowedScopes (ImmutableSet .of ("openid" , "phone" ));
1291
1278
site1 .setApprovedAccessTokens (ImmutableSet .of (mockToken1 ));
1292
1279
@@ -1367,8 +1354,8 @@ public OAuth2AccessTokenEntity answer(InvocationOnMock invocation) throws Throwa
1367
1354
});
1368
1355
1369
1356
dataService .importData (reader );
1370
- //2 for sites, 1 for updating access token ref on #1, 1 more for updating whitelistedSite ref on #2
1371
- verify (approvedSiteRepository , times (4 )).save (capturedApprovedSites .capture ());
1357
+ //2 for sites, 1 for updating access token ref on #1
1358
+ verify (approvedSiteRepository , times (3 )).save (capturedApprovedSites .capture ());
1372
1359
1373
1360
List <ApprovedSite > savedSites = new ArrayList (fakeDb .values ());
1374
1361
@@ -1378,7 +1365,6 @@ public OAuth2AccessTokenEntity answer(InvocationOnMock invocation) throws Throwa
1378
1365
assertThat (savedSites .get (0 ).getAccessDate (), equalTo (site1 .getAccessDate ()));
1379
1366
assertThat (savedSites .get (0 ).getCreationDate (), equalTo (site1 .getCreationDate ()));
1380
1367
assertThat (savedSites .get (0 ).getAllowedScopes (), equalTo (site1 .getAllowedScopes ()));
1381
- assertThat (savedSites .get (0 ).getIsWhitelisted (), equalTo (site1 .getIsWhitelisted ()));
1382
1368
assertThat (savedSites .get (0 ).getTimeoutDate (), equalTo (site1 .getTimeoutDate ()));
1383
1369
assertThat (savedSites .get (0 ).getApprovedAccessTokens ().size (), equalTo (site1 .getApprovedAccessTokens ().size ()));
1384
1370
@@ -1387,7 +1373,6 @@ public OAuth2AccessTokenEntity answer(InvocationOnMock invocation) throws Throwa
1387
1373
assertThat (savedSites .get (1 ).getCreationDate (), equalTo (site2 .getCreationDate ()));
1388
1374
assertThat (savedSites .get (1 ).getAllowedScopes (), equalTo (site2 .getAllowedScopes ()));
1389
1375
assertThat (savedSites .get (1 ).getTimeoutDate (), equalTo (site2 .getTimeoutDate ()));
1390
- assertThat (savedSites .get (1 ).getIsWhitelisted (), equalTo (site2 .getIsWhitelisted ()));
1391
1376
assertThat (savedSites .get (1 ).getApprovedAccessTokens ().size (), equalTo (site2 .getApprovedAccessTokens ().size ()));
1392
1377
}
1393
1378
0 commit comments