summaryrefslogtreecommitdiffstats
path: root/container-search/src/test/java/com/yahoo/search/grouping/result/GroupTestCase.java
diff options
context:
space:
mode:
Diffstat (limited to 'container-search/src/test/java/com/yahoo/search/grouping/result/GroupTestCase.java')
-rw-r--r--container-search/src/test/java/com/yahoo/search/grouping/result/GroupTestCase.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/container-search/src/test/java/com/yahoo/search/grouping/result/GroupTestCase.java b/container-search/src/test/java/com/yahoo/search/grouping/result/GroupTestCase.java
new file mode 100644
index 00000000000..9acab986ac2
--- /dev/null
+++ b/container-search/src/test/java/com/yahoo/search/grouping/result/GroupTestCase.java
@@ -0,0 +1,31 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.search.grouping.result;
+
+import com.yahoo.search.result.Hit;
+import com.yahoo.search.result.Relevance;
+import org.junit.Test;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+/**
+ * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
+ */
+public class GroupTestCase {
+
+ @Test
+ public void requireThatListsAreAccessibleByLabel() {
+ Group grp = new Group(new LongId(69L), new Relevance(1));
+ grp.add(new Hit("hit"));
+ grp.add(new HitList("hitList"));
+ grp.add(new GroupList("groupList"));
+
+ assertNotNull(grp.getGroupList("groupList"));
+ assertNull(grp.getGroupList("unknownGroupList"));
+ assertNull(grp.getGroupList("hitList"));
+
+ assertNotNull(grp.getHitList("hitList"));
+ assertNull(grp.getHitList("unknownHitList"));
+ assertNull(grp.getHitList("groupList"));
+ }
+}