From 2e4e33a90cac98a3a1b988844c069a8c46c64614 Mon Sep 17 00:00:00 2001 From: Hicham Boushaba Date: Thu, 25 Jul 2024 11:01:33 +0100 Subject: [PATCH] Remove the outdated tests --- .../android/fluxc/site/SiteStoreUnitTest.java | 56 ------------------- 1 file changed, 56 deletions(-) diff --git a/example/src/test/java/org/wordpress/android/fluxc/site/SiteStoreUnitTest.java b/example/src/test/java/org/wordpress/android/fluxc/site/SiteStoreUnitTest.java index 23908e3135..049e6fd0fc 100644 --- a/example/src/test/java/org/wordpress/android/fluxc/site/SiteStoreUnitTest.java +++ b/example/src/test/java/org/wordpress/android/fluxc/site/SiteStoreUnitTest.java @@ -604,32 +604,6 @@ public void testWPComAutomatedTransfer() throws DuplicateSiteException { assertEquals(0, mSiteStore.getWPComSitesCount()); } - @Test - public void testBatchInsertSiteDuplicateWPCom() - throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { - WellSqlTestUtils.setupWordPressComAccount(); - - List siteList = new ArrayList<>(); - siteList.add(generateTestSite(1, "https://pony1.com", "https://pony1.com/xmlrpc.php", true, true)); - siteList.add(generateTestSite(2, "https://pony2.com", "https://pony2.com/xmlrpc.php", true, true)); - siteList.add(generateTestSite(3, "https://pony3.com", "https://pony3.com/xmlrpc.php", true, true)); - // duplicate with a different id, we should ignore it - siteList.add(generateTestSite(4, "https://pony3.com", "https://pony3.com/xmlrpc.php", true, true)); - siteList.add(generateTestSite(5, "https://pony4.com", "https://pony4.com/xmlrpc.php", true, true)); - siteList.add(generateTestSite(6, "https://pony5.com", "https://pony5.com/xmlrpc.php", true, true)); - - SitesModel sites = new SitesModel(siteList); - - // Use reflection to call a private Store method: equivalent to mSiteStore.updateSites(sites) - Method createOrUpdateSites = SiteStore.class.getDeclaredMethod("createOrUpdateSites", SitesModel.class); - createOrUpdateSites.setAccessible(true); - UpdateSitesResult res = (UpdateSitesResult) createOrUpdateSites.invoke(mSiteStore, sites); - - assertTrue(res.duplicateSiteFound); - assertEquals(5, res.rowsAffected); - assertEquals(5, mSiteStore.getSitesCount()); - } - @Test public void testBatchInsertSiteNoDuplicateWPCom() throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { @@ -654,36 +628,6 @@ public void testBatchInsertSiteNoDuplicateWPCom() assertEquals(5, mSiteStore.getSitesCount()); } - @Test - public void testSingleInsertSiteDuplicateWPCom() - throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { - WellSqlTestUtils.setupWordPressComAccount(); - - List siteList = new ArrayList<>(); - siteList.add(generateTestSite(1, "https://pony1.com", "https://pony1.com/xmlrpc.php", true, true)); - SitesModel sites = new SitesModel(siteList); - - // Insert 1 site - Method createOrUpdateSites = SiteStore.class.getDeclaredMethod("createOrUpdateSites", SitesModel.class); - createOrUpdateSites.setAccessible(true); - UpdateSitesResult res = (UpdateSitesResult) createOrUpdateSites.invoke(mSiteStore, sites); - - assertFalse(res.duplicateSiteFound); - assertEquals(1, res.rowsAffected); - assertEquals(1, mSiteStore.getSitesCount()); - - // Insert same site with different id (considered a duplicate) - List siteList2 = new ArrayList<>(); - siteList2.add(generateTestSite(2, "https://pony1.com", "https://pony1.com/xmlrpc.php", true, true)); - SitesModel sites2 = new SitesModel(siteList2); - createOrUpdateSites.setAccessible(true); - UpdateSitesResult res2 = (UpdateSitesResult) createOrUpdateSites.invoke(mSiteStore, sites2); - - assertTrue(res2.duplicateSiteFound); - assertEquals(0, res2.rowsAffected); - assertEquals(1, mSiteStore.getSitesCount()); - } - @Test public void testInsertSiteDuplicateXmlRpcTrailingSlash() throws DuplicateSiteException { // It's possible for the URL in `wp.getOptions` to be different from the URL in `wp.getUsersBlogs`,