1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.openehealth.ipf.platform.camel.ihe.fhir.iti78;
18
19 import org.hl7.fhir.dstu3.model.Bundle;
20 import org.hl7.fhir.dstu3.model.ResourceType;
21 import org.junit.BeforeClass;
22 import org.junit.Test;
23
24 import javax.servlet.ServletException;
25
26 import static org.junit.Assert.assertEquals;
27 import static org.junit.Assert.assertTrue;
28
29
30
31
32 public class TestIti78Paging extends AbstractTestIti78 {
33
34 private static final String CONTEXT_DESCRIPTOR = "iti-78-paging.xml";
35
36 @BeforeClass
37 public static void setUpClass() throws ServletException {
38 startServer(CONTEXT_DESCRIPTOR, false);
39 startClient();
40 }
41
42
43 @Test
44 public void testSendManualPdqmWithCount() {
45
46 Bundle page1 = sendManuallyWithCount(familyParameters(), 2);
47
48 assertEquals(Bundle.BundleType.SEARCHSET, page1.getType());
49 assertEquals(ResourceType.Bundle, page1.getResourceType());
50 assertTrue(page1.hasEntry());
51 assertEquals(3, page1.getTotal());
52 assertEquals(2, page1.getEntry().size());
53
54 Bundle page2 = nextPage(page1);
55 assertEquals(Bundle.BundleType.SEARCHSET, page2.getType());
56 assertEquals(ResourceType.Bundle, page2.getResourceType());
57 assertTrue(page2.hasEntry());
58 assertEquals(3, page2.getTotal());
59 assertEquals(1, page2.getEntry().size());
60
61 }
62 }