blob: 5f1d2d3f1257cbcae7164d0132578fb554f7573b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// Copyright Yahoo. 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.grouping.Continuation;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertSame;
/**
* @author Simon Thoresen Hult
*/
public class HitListTestCase {
@Test
void requireThatAccessorsWork() {
HitList lst = new HitList("foo");
assertEquals("foo", lst.getLabel());
assertEquals(0, lst.continuations().size());
MyContinuation foo = new MyContinuation();
lst.continuations().put("foo", foo);
assertEquals(1, lst.continuations().size());
assertSame(foo, lst.continuations().get("foo"));
MyContinuation bar = new MyContinuation();
lst.continuations().put("bar", bar);
assertEquals(2, lst.continuations().size());
assertSame(bar, lst.continuations().get("bar"));
}
private static class MyContinuation extends Continuation {
@Override
public Continuation copy() {
return null;
}
}
}
|