@@ -1140,9 +1140,6 @@ public void testExportGrants() throws IOException, ParseException {
11401140Date creationDate1 = formatter .parse ("2014-09-10T22:49:44.090+0000" , Locale .ENGLISH );
11411141Date accessDate1 = formatter .parse ("2014-09-10T23:49:44.090+0000" , Locale .ENGLISH );
11421142
1143- WhitelistedSite mockWlSite1 = mock (WhitelistedSite .class );
1144- when (mockWlSite1 .getId ()).thenReturn (1L );
1145-
11461143OAuth2AccessTokenEntity mockToken1 = mock (OAuth2AccessTokenEntity .class );
11471144when (mockToken1 .getId ()).thenReturn (1L );
11481145
@@ -1152,7 +1149,6 @@ public void testExportGrants() throws IOException, ParseException {
11521149site1 .setCreationDate (creationDate1 );
11531150site1 .setAccessDate (accessDate1 );
11541151site1 .setUserId ("user1" );
1155- site1 .setWhitelistedSite (mockWlSite1 );
11561152site1 .setAllowedScopes (ImmutableSet .of ("openid" , "phone" ));
11571153site1 .setApprovedAccessTokens (ImmutableSet .of (mockToken1 ));
11581154
@@ -1247,11 +1243,6 @@ public void testExportGrants() throws IOException, ParseException {
12471243}
12481244assertThat (site .get ("userId" ).getAsString (), equalTo (compare .getUserId ()));
12491245assertThat (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- }
12551246if (site .get ("approvedAccessTokens" ).isJsonNull () || site .getAsJsonArray ("approvedAccessTokens" ) == null ) {
12561247assertTrue (compare .getApprovedAccessTokens () == null || compare .getApprovedAccessTokens ().isEmpty ());
12571248} else {
@@ -1274,9 +1265,6 @@ public void testImportGrants() throws IOException, ParseException {
12741265Date creationDate1 = formatter .parse ("2014-09-10T22:49:44.090+0000" , Locale .ENGLISH );
12751266Date accessDate1 = formatter .parse ("2014-09-10T23:49:44.090+0000" , Locale .ENGLISH );
12761267
1277- WhitelistedSite mockWlSite1 = mock (WhitelistedSite .class );
1278- when (mockWlSite1 .getId ()).thenReturn (1L );
1279-
12801268OAuth2AccessTokenEntity mockToken1 = mock (OAuth2AccessTokenEntity .class );
12811269when (mockToken1 .getId ()).thenReturn (1L );
12821270
@@ -1286,7 +1274,6 @@ public void testImportGrants() throws IOException, ParseException {
12861274site1 .setCreationDate (creationDate1 );
12871275site1 .setAccessDate (accessDate1 );
12881276site1 .setUserId ("user1" );
1289- site1 .setWhitelistedSite (mockWlSite1 );
12901277site1 .setAllowedScopes (ImmutableSet .of ("openid" , "phone" ));
12911278site1 .setApprovedAccessTokens (ImmutableSet .of (mockToken1 ));
12921279
@@ -1367,8 +1354,8 @@ public OAuth2AccessTokenEntity answer(InvocationOnMock invocation) throws Throwa
13671354});
13681355
13691356dataService .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 ());
13721359
13731360List <ApprovedSite > savedSites = new ArrayList (fakeDb .values ());
13741361
@@ -1378,7 +1365,6 @@ public OAuth2AccessTokenEntity answer(InvocationOnMock invocation) throws Throwa
13781365assertThat (savedSites .get (0 ).getAccessDate (), equalTo (site1 .getAccessDate ()));
13791366assertThat (savedSites .get (0 ).getCreationDate (), equalTo (site1 .getCreationDate ()));
13801367assertThat (savedSites .get (0 ).getAllowedScopes (), equalTo (site1 .getAllowedScopes ()));
1381- assertThat (savedSites .get (0 ).getIsWhitelisted (), equalTo (site1 .getIsWhitelisted ()));
13821368assertThat (savedSites .get (0 ).getTimeoutDate (), equalTo (site1 .getTimeoutDate ()));
13831369assertThat (savedSites .get (0 ).getApprovedAccessTokens ().size (), equalTo (site1 .getApprovedAccessTokens ().size ()));
13841370
@@ -1387,7 +1373,6 @@ public OAuth2AccessTokenEntity answer(InvocationOnMock invocation) throws Throwa
13871373assertThat (savedSites .get (1 ).getCreationDate (), equalTo (site2 .getCreationDate ()));
13881374assertThat (savedSites .get (1 ).getAllowedScopes (), equalTo (site2 .getAllowedScopes ()));
13891375assertThat (savedSites .get (1 ).getTimeoutDate (), equalTo (site2 .getTimeoutDate ()));
1390- assertThat (savedSites .get (1 ).getIsWhitelisted (), equalTo (site2 .getIsWhitelisted ()));
13911376assertThat (savedSites .get (1 ).getApprovedAccessTokens ().size (), equalTo (site2 .getApprovedAccessTokens ().size ()));
13921377}
13931378
0 commit comments