From 8cb19db37178e73b2d719a18d98ffb2a289727fe Mon Sep 17 00:00:00 2001 From: jensp Date: Thu, 30 Nov 2017 09:58:06 +0000 Subject: [PATCH] CCM NG: Fixed bug git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5150 8810af33-2d31-482b-a856-94f89814c4df --- .../categorization/CategoryManagerTest.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ccm-core/src/test/java/org/libreccm/categorization/CategoryManagerTest.java b/ccm-core/src/test/java/org/libreccm/categorization/CategoryManagerTest.java index 675d59523..8c22174ed 100644 --- a/ccm-core/src/test/java/org/libreccm/categorization/CategoryManagerTest.java +++ b/ccm-core/src/test/java/org/libreccm/categorization/CategoryManagerTest.java @@ -571,7 +571,7 @@ public class CategoryManagerTest { final Optional bar = categoryRepo.findById(-2200L); shiro.getSystemUser().execute( - () -> categoryManager.removeSubCategoryFromCategory(bar.get(), + () -> categoryManager.removeSubCategoryFromCategory(bar.get(), foo.get())); } @@ -713,8 +713,7 @@ public class CategoryManagerTest { /** * Tries to retrieve the index object from several categories and verifies - * that the expected object is returned by - * {@link CategoryManager#getIndexObject(org.libreccm.categorization.Category). + * that the expected object is returned by null {@link CategoryManager#getIndexObject(org.libreccm.categorization.Category). */ @Test @UsingDataSet( @@ -724,11 +723,17 @@ public class CategoryManagerTest { final Optional category1 = categoryRepo.findById(-2100L); final Optional category2 = categoryRepo.findById(-2200L); - assertThat(categoryManager.getIndexObject(category1.get()).isPresent(), + assertThat(categoryManager + .getIndexObject(category1.get()) + .stream() + .findFirst() + .isPresent(), is(false)); final Optional index2 = categoryManager.getIndexObject( - category2.get()); + category2.get()) + .stream() + .findFirst(); assertThat(index2.isPresent(), is(true)); assertThat(index2.get().getDisplayName(), is(equalTo("object3"))); }