CCM NG: Fixed bug

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@5150 8810af33-2d31-482b-a856-94f89814c4df

Former-commit-id: 9b3329756e
pull/2/head
jensp 2017-11-30 09:58:06 +00:00
parent e434ab5081
commit 1ab25c3dae
1 changed files with 10 additions and 5 deletions

View File

@ -713,8 +713,7 @@ public class CategoryManagerTest {
/** /**
* Tries to retrieve the index object from several categories and verifies * Tries to retrieve the index object from several categories and verifies
* that the expected object is returned by * that the expected object is returned by null {@link CategoryManager#getIndexObject(org.libreccm.categorization.Category).
* {@link CategoryManager#getIndexObject(org.libreccm.categorization.Category).
*/ */
@Test @Test
@UsingDataSet( @UsingDataSet(
@ -724,11 +723,17 @@ public class CategoryManagerTest {
final Optional<Category> category1 = categoryRepo.findById(-2100L); final Optional<Category> category1 = categoryRepo.findById(-2100L);
final Optional<Category> category2 = categoryRepo.findById(-2200L); final Optional<Category> category2 = categoryRepo.findById(-2200L);
assertThat(categoryManager.getIndexObject(category1.get()).isPresent(), assertThat(categoryManager
.getIndexObject(category1.get())
.stream()
.findFirst()
.isPresent(),
is(false)); is(false));
final Optional<CcmObject> index2 = categoryManager.getIndexObject( final Optional<CcmObject> index2 = categoryManager.getIndexObject(
category2.get()); category2.get())
.stream()
.findFirst();
assertThat(index2.isPresent(), is(true)); assertThat(index2.isPresent(), is(true));
assertThat(index2.get().getDisplayName(), is(equalTo("object3"))); assertThat(index2.get().getDisplayName(), is(equalTo("object3")));
} }