From 6b612bdf9ff8e8b40d35afeefd05defe12bc7e61 Mon Sep 17 00:00:00 2001 From: Sai Pullabhotla Date: Mon, 12 Feb 2018 20:27:07 -0600 Subject: [PATCH] Remove the workaround used in EntityManagerTest #193 --- .../jmethods/catatumbo/EntityManagerTest.java | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/src/test/java/com/jmethods/catatumbo/EntityManagerTest.java b/src/test/java/com/jmethods/catatumbo/EntityManagerTest.java index ce3e175..e779e9d 100644 --- a/src/test/java/com/jmethods/catatumbo/EntityManagerTest.java +++ b/src/test/java/com/jmethods/catatumbo/EntityManagerTest.java @@ -128,7 +128,6 @@ import com.jmethods.catatumbo.entities.WrappedLongIdEntity; import com.jmethods.catatumbo.entities.WrappedLongObjectIdEntity; import com.jmethods.catatumbo.entities.ZonedDateTimeField; -import com.jmethods.catatumbo.impl.DefaultEntityManager; /** * @author Sai Pullabhotla @@ -1562,17 +1561,7 @@ public void testUpdate_ThatDoesNotExist() { em.delete(entity); LongId entity2 = em.load(LongId.class, entity.getId()); if (entity2 == null) { - try { - em.update(entity); - } catch (EntityNotFoundException exp) { - throw exp; - } catch (EntityManagerException exp) { - String host = ((DefaultEntityManager) em).getDatastore().getOptions().getHost(); - if (!ConnectionParameters.DEFAULT_SERVICE_URL.equals(host)) { - // Running on emulator that has a bug. - throw new EntityNotFoundException(exp); - } - } + em.update(entity); } } @@ -3480,17 +3469,7 @@ public void testDuplicateKey() { StringField entity = new StringField(); entity.setName("Dup Test"); entity = em.insert(entity); - try { - entity = em.insert(entity); - } catch (EntityAlreadyExistsException exp) { - throw exp; - } catch (EntityManagerException exp) { - String host = ((DefaultEntityManager) em).getDatastore().getOptions().getHost(); - if (!ConnectionParameters.DEFAULT_SERVICE_URL.equals(host)) { - // Running on emulator that has a bug. - throw new EntityAlreadyExistsException(exp); - } - } + entity = em.insert(entity); } private static Calendar getToday() {