@@ -604,32 +604,6 @@ public void testWPComAutomatedTransfer() throws DuplicateSiteException {
604604 assertEquals (0 , mSiteStore .getWPComSitesCount ());
605605 }
606606
607- @ Test
608- public void testBatchInsertSiteDuplicateWPCom ()
609- throws NoSuchMethodException , IllegalAccessException , InvocationTargetException {
610- WellSqlTestUtils .setupWordPressComAccount ();
611-
612- List <SiteModel > siteList = new ArrayList <>();
613- siteList .add (generateTestSite (1 , "https://pony1.com" , "https://pony1.com/xmlrpc.php" , true , true ));
614- siteList .add (generateTestSite (2 , "https://pony2.com" , "https://pony2.com/xmlrpc.php" , true , true ));
615- siteList .add (generateTestSite (3 , "https://pony3.com" , "https://pony3.com/xmlrpc.php" , true , true ));
616- // duplicate with a different id, we should ignore it
617- siteList .add (generateTestSite (4 , "https://pony3.com" , "https://pony3.com/xmlrpc.php" , true , true ));
618- siteList .add (generateTestSite (5 , "https://pony4.com" , "https://pony4.com/xmlrpc.php" , true , true ));
619- siteList .add (generateTestSite (6 , "https://pony5.com" , "https://pony5.com/xmlrpc.php" , true , true ));
620-
621- SitesModel sites = new SitesModel (siteList );
622-
623- // Use reflection to call a private Store method: equivalent to mSiteStore.updateSites(sites)
624- Method createOrUpdateSites = SiteStore .class .getDeclaredMethod ("createOrUpdateSites" , SitesModel .class );
625- createOrUpdateSites .setAccessible (true );
626- UpdateSitesResult res = (UpdateSitesResult ) createOrUpdateSites .invoke (mSiteStore , sites );
627-
628- assertTrue (res .duplicateSiteFound );
629- assertEquals (5 , res .rowsAffected );
630- assertEquals (5 , mSiteStore .getSitesCount ());
631- }
632-
633607 @ Test
634608 public void testBatchInsertSiteNoDuplicateWPCom ()
635609 throws NoSuchMethodException , IllegalAccessException , InvocationTargetException {
@@ -654,36 +628,6 @@ public void testBatchInsertSiteNoDuplicateWPCom()
654628 assertEquals (5 , mSiteStore .getSitesCount ());
655629 }
656630
657- @ Test
658- public void testSingleInsertSiteDuplicateWPCom ()
659- throws NoSuchMethodException , IllegalAccessException , InvocationTargetException {
660- WellSqlTestUtils .setupWordPressComAccount ();
661-
662- List <SiteModel > siteList = new ArrayList <>();
663- siteList .add (generateTestSite (1 , "https://pony1.com" , "https://pony1.com/xmlrpc.php" , true , true ));
664- SitesModel sites = new SitesModel (siteList );
665-
666- // Insert 1 site
667- Method createOrUpdateSites = SiteStore .class .getDeclaredMethod ("createOrUpdateSites" , SitesModel .class );
668- createOrUpdateSites .setAccessible (true );
669- UpdateSitesResult res = (UpdateSitesResult ) createOrUpdateSites .invoke (mSiteStore , sites );
670-
671- assertFalse (res .duplicateSiteFound );
672- assertEquals (1 , res .rowsAffected );
673- assertEquals (1 , mSiteStore .getSitesCount ());
674-
675- // Insert same site with different id (considered a duplicate)
676- List <SiteModel > siteList2 = new ArrayList <>();
677- siteList2 .add (generateTestSite (2 , "https://pony1.com" , "https://pony1.com/xmlrpc.php" , true , true ));
678- SitesModel sites2 = new SitesModel (siteList2 );
679- createOrUpdateSites .setAccessible (true );
680- UpdateSitesResult res2 = (UpdateSitesResult ) createOrUpdateSites .invoke (mSiteStore , sites2 );
681-
682- assertTrue (res2 .duplicateSiteFound );
683- assertEquals (0 , res2 .rowsAffected );
684- assertEquals (1 , mSiteStore .getSitesCount ());
685- }
686-
687631 @ Test
688632 public void testInsertSiteDuplicateXmlRpcTrailingSlash () throws DuplicateSiteException {
689633 // It's possible for the URL in `wp.getOptions` to be different from the URL in `wp.getUsersBlogs`,
0 commit comments