From 8bdcb8ef0fecdf81970b4733530cd417f4f60384 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Mon, 4 Mar 2013 16:24:22 -0800 Subject: [PATCH] Fixed bugs in unit tests from references to rmilk --- .../astrid/service/UpdateMessageServiceTest.java | 13 +++++++------ .../astrid/upgrade/Astrid2To3UpgradeTests.java | 10 ---------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/tests/src/com/todoroo/astrid/service/UpdateMessageServiceTest.java b/tests/src/com/todoroo/astrid/service/UpdateMessageServiceTest.java index 838cb28e3..e52313b5d 100644 --- a/tests/src/com/todoroo/astrid/service/UpdateMessageServiceTest.java +++ b/tests/src/com/todoroo/astrid/service/UpdateMessageServiceTest.java @@ -10,18 +10,19 @@ import java.io.IOException; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.json.JSONArray; -import org.weloveastrid.rmilk.MilkUtilities; import com.todoroo.andlib.service.Autowired; import com.todoroo.andlib.service.RestClient; import com.todoroo.astrid.dao.StoreObjectDao; import com.todoroo.astrid.dao.StoreObjectDao.StoreObjectCriteria; +import com.todoroo.astrid.gtasks.GtasksPreferenceService; import com.todoroo.astrid.test.DatabaseTestCase; import com.todoroo.astrid.utility.Constants; public class UpdateMessageServiceTest extends DatabaseTestCase { @Autowired private StoreObjectDao storeObjectDao; + @Autowired private GtasksPreferenceService gtasksPreferenceService; public void testNoUpdates() { clearLatestUpdates(); @@ -148,25 +149,25 @@ public class UpdateMessageServiceTest extends DatabaseTestCase { public void testUpdateWithInternalPluginOn() { clearLatestUpdates(); - MilkUtilities.INSTANCE.setToken("milk"); + gtasksPreferenceService.setToken("gtasks"); new TestUpdateMessageService() { @Override void verifyMessage(MessageTuple message) { - assertTrue(message.message.toString().contains("rmilk man")); + assertTrue(message.message.toString().contains("gtasks man")); } @Override String getUpdates(String url) throws IOException { - return "[{message:'rmilk man',plugin:'rmilk'}]"; + return "[{message:'gtasks man',plugin:'gtasks'}]"; } }.processUpdates(); } public void testUpdateWithInternalPluginOff() { clearLatestUpdates(); - MilkUtilities.INSTANCE.setToken(null); + gtasksPreferenceService.setToken(null); new TestUpdateMessageService() { @@ -182,7 +183,7 @@ public class UpdateMessageServiceTest extends DatabaseTestCase { @Override String getUpdates(String url) throws IOException { - return "[{message:'rmilk man',plugin:'rmilk'}]"; + return "[{message:'gtasks man',plugin:'gtasks'}]"; } }.processUpdates(); } diff --git a/tests/src/com/todoroo/astrid/upgrade/Astrid2To3UpgradeTests.java b/tests/src/com/todoroo/astrid/upgrade/Astrid2To3UpgradeTests.java index a60b63b54..09e74560b 100644 --- a/tests/src/com/todoroo/astrid/upgrade/Astrid2To3UpgradeTests.java +++ b/tests/src/com/todoroo/astrid/upgrade/Astrid2To3UpgradeTests.java @@ -409,16 +409,6 @@ public class Astrid2To3UpgradeTests extends DatabaseTestCase { // verify that data exists in our new table database.openForReading(); - - TodorooCursor cursor = metadataDao.query(Query.select( - Metadata.PROPERTIES).where(MetadataCriteria.withKey("rmilk"))); - assertEquals(1, cursor.getCount()); - cursor.moveToFirst(); - Metadata metadata = new Metadata(cursor); - assertEquals("123", metadata.getValue(Metadata.VALUE1)); - assertEquals("456", metadata.getValue(Metadata.VALUE2)); - assertEquals("789000", metadata.getValue(Metadata.VALUE3)); - cursor.close(); }