From 00530155f4133fcbbcfd9b262f863eb0ce58d6ef Mon Sep 17 00:00:00 2001 From: jensp Date: Fri, 3 May 2019 17:58:10 +0000 Subject: [PATCH] CCM NG: Fixed test failures in ItemAttachmentManagerTest git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@6005 8810af33-2d31-482b-a856-94f89814c4df Former-commit-id: 9a30fe287be4b3f74a05111f7b642159b35a2067 --- .../ItemAttachmentManagerTest.java | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/ccm-cms/src/test/java/org/librecms/contentsection/ItemAttachmentManagerTest.java b/ccm-cms/src/test/java/org/librecms/contentsection/ItemAttachmentManagerTest.java index c2b5faadc..b89ff9e56 100644 --- a/ccm-cms/src/test/java/org/librecms/contentsection/ItemAttachmentManagerTest.java +++ b/ccm-cms/src/test/java/org/librecms/contentsection/ItemAttachmentManagerTest.java @@ -151,6 +151,7 @@ public class ItemAttachmentManagerTest { .addClass( com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class) .addClass(org.librecms.dispatcher.ItemResolver.class) + .addClass(org.libreccm.imexport.Exportable.class) .addPackage(com.arsdigita.util.Lockable.class.getPackage()) .addPackage(com.arsdigita.web.BaseServlet.class.getPackage()) .addPackage(org.librecms.Cms.class.getPackage()) @@ -217,10 +218,10 @@ public class ItemAttachmentManagerTest { public void attachNonSharedAsset() throws MimeTypeParseException { shiro.getSystemUser().execute(() -> { - final Optional item = itemRepo.findById(-510L); + final Optional item = itemRepo.findById(510L); assertThat(item.isPresent(), is(true)); - final Asset file = assetRepo.findById(-720L).get(); + final Asset file = assetRepo.findById(720L).get(); attachmentManager.attachAsset(file, item.get().getAttachments().get( 1)); @@ -246,10 +247,10 @@ public class ItemAttachmentManagerTest { public void attachSharedAsset() throws MimeTypeParseException { shiro.getSystemUser().execute(() -> { - final Optional item = itemRepo.findById(-510L); + final Optional item = itemRepo.findById(510L); assertThat(item.isPresent(), is(true)); - final Asset shared = assetRepo.findById(-610L).get(); + final Asset shared = assetRepo.findById(610L).get(); attachmentManager.attachAsset(shared, item.get().getAttachments().get(1)); @@ -271,10 +272,10 @@ public class ItemAttachmentManagerTest { public void attachAssetAlreadyAttached() { shiro.getSystemUser().execute(() -> { - final Optional item = itemRepo.findById(-510L); + final Optional item = itemRepo.findById(510L); assertThat(item.isPresent(), is(true)); - final Asset shared = assetRepo.findById(-620L).get(); + final Asset shared = assetRepo.findById(620L).get(); attachmentManager.attachAsset(shared, item.get().getAttachments().get(1)); @@ -297,7 +298,7 @@ public class ItemAttachmentManagerTest { public void attachAssetNull() { shiro.getSystemUser().execute(() -> { - final Optional item = itemRepo.findById(-510L); + final Optional item = itemRepo.findById(510L); assertThat(item.isPresent(), is(true)); final Asset asset = null; @@ -324,7 +325,7 @@ public class ItemAttachmentManagerTest { shiro.getSystemUser().execute(() -> { final AttachmentList list = null; - final Asset shared = assetRepo.findById(-610L).get(); + final Asset shared = assetRepo.findById(610L).get(); attachmentManager.attachAsset(shared, list); }); @@ -346,8 +347,8 @@ public class ItemAttachmentManagerTest { public void unattachSharedAsset() { shiro.getSystemUser().execute(() -> { - final Asset asset = assetRepo.findById(-610L).get(); - final Optional item = itemRepo.findById(-510L); + final Asset asset = assetRepo.findById(610L).get(); + final Optional item = itemRepo.findById(510L); assertThat(asset, is(not(nullValue()))); assertThat(item.isPresent(), is(true)); @@ -376,8 +377,8 @@ public class ItemAttachmentManagerTest { public void unattachNonSharedAsset() { shiro.getSystemUser().execute(() -> { - final Asset asset = assetRepo.findById(-720L).get(); - final Optional item = itemRepo.findById(-510L); + final Asset asset = assetRepo.findById(720L).get(); + final Optional item = itemRepo.findById(510L); assertThat(asset, is(not(nullValue()))); assertThat(item.isPresent(), is(true)); @@ -403,8 +404,8 @@ public class ItemAttachmentManagerTest { public void unattachAssetNotAttached() { shiro.getSystemUser().execute(() -> { - final Asset asset = assetRepo.findById(-720L).get(); - final Optional item = itemRepo.findById(-510L); + final Asset asset = assetRepo.findById(720L).get(); + final Optional item = itemRepo.findById(510L); assertThat(asset, is(not(nullValue()))); assertThat(item.isPresent(), is(true)); @@ -433,7 +434,7 @@ public class ItemAttachmentManagerTest { shiro.getSystemUser().execute(() -> { final Asset asset = null; - final Optional item = itemRepo.findById(-510L); + final Optional item = itemRepo.findById(510L); assertThat(item.isPresent(), is(true)); final AttachmentList list = item.get().getAttachments().get(0); @@ -458,7 +459,7 @@ public class ItemAttachmentManagerTest { public void unattachAssetFromListNull() { shiro.getSystemUser().execute(() -> { - final Asset asset = assetRepo.findById(-720L).get(); + final Asset asset = assetRepo.findById(720L).get(); assertThat(asset, is(not(nullValue()))); final AttachmentList list = null; @@ -483,7 +484,7 @@ public class ItemAttachmentManagerTest { public void moveUp() { shiro.getSystemUser().execute(() -> { - final Optional item = itemRepo.findById(-510L); + final Optional item = itemRepo.findById(510L); assertThat(item.isPresent(), is(true)); final AttachmentList list = item.get().getAttachments().get(0); @@ -507,7 +508,7 @@ public class ItemAttachmentManagerTest { public void moveUpLast() { shiro.getSystemUser().execute(() -> { - final Optional item = itemRepo.findById(-510L); + final Optional item = itemRepo.findById(510L); assertThat(item.isPresent(), is(true)); final AttachmentList list = item.get().getAttachments().get(0); @@ -533,7 +534,7 @@ public class ItemAttachmentManagerTest { public void moveUpNull() { shiro.getSystemUser().execute(() -> { - final Optional item = itemRepo.findById(-510L); + final Optional item = itemRepo.findById(510L); assertThat(item.isPresent(), is(true)); final AttachmentList list = item.get().getAttachments().get(0); @@ -558,7 +559,7 @@ public class ItemAttachmentManagerTest { public void moveUpInListNull() { shiro.getSystemUser().execute(() -> { - final Asset asset = assetRepo.findById(-720L).get(); + final Asset asset = assetRepo.findById(720L).get(); assertThat(asset, is(not(nullValue()))); final AttachmentList list = null; @@ -583,7 +584,7 @@ public class ItemAttachmentManagerTest { public void moveDown() { shiro.getSystemUser().execute(() -> { - final Optional item = itemRepo.findById(-510L); + final Optional item = itemRepo.findById(510L); assertThat(item.isPresent(), is(true)); final AttachmentList list = item.get().getAttachments().get(0); @@ -607,7 +608,7 @@ public class ItemAttachmentManagerTest { public void moveDownFirst() { shiro.getSystemUser().execute(() -> { - final Optional item = itemRepo.findById(-510L); + final Optional item = itemRepo.findById(510L); assertThat(item.isPresent(), is(true)); final AttachmentList list = item.get().getAttachments().get(0); @@ -633,7 +634,7 @@ public class ItemAttachmentManagerTest { public void moveDownNull() { shiro.getSystemUser().execute(() -> { - final Optional item = itemRepo.findById(-510L); + final Optional item = itemRepo.findById(510L); assertThat(item.isPresent(), is(true)); final AttachmentList list = item.get().getAttachments().get(0); @@ -658,7 +659,7 @@ public class ItemAttachmentManagerTest { public void moveDownInListNull() { shiro.getSystemUser().execute(() -> { - final Asset asset = assetRepo.findById(-720L).get(); + final Asset asset = assetRepo.findById(720L).get(); assertThat(asset, is(not(nullValue()))); final AttachmentList list = null;