Skip to content

Commit 7cd8367

Browse files
committed
FIxed tests
1 parent 53b6f1e commit 7cd8367

4 files changed

Lines changed: 15 additions & 12 deletions

File tree

src/test/java/panl/Root.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public class Root {
8383
@JsonIgnore public Object configuration;
8484
@JsonIgnore public Object parameters;
8585

86-
public Response response;
86+
public Response[] response;
8787
public Panl panl;
8888
public boolean error;
8989

@@ -128,7 +128,7 @@ public void setError(
128128
*
129129
* @return the response
130130
*/
131-
public Response getResponse() {
131+
public Response[] getResponse() {
132132
return response;
133133
}
134134
/**
@@ -137,7 +137,7 @@ public Response getResponse() {
137137
* @param response the response to set
138138
*/
139139
public void setResponse(
140-
Response response) {
140+
Response[] response) {
141141
this.response = response;
142142
}
143143

src/test/java/panl/response/panl/Response.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,15 @@
4949
package panl.response.panl;
5050

5151
import com.fasterxml.jackson.annotation.JsonIgnore;
52+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
5253
import panl.response.panl.response.Doc;
5354

55+
@JsonIgnoreProperties(ignoreUnknown = true)
5456
public class Response {
5557
@JsonIgnore public Doc[] docs;
56-
public long numFound;
57-
public long start;
58-
public long maxScore;
59-
public boolean numFoundExact;
58+
@JsonIgnore public long numFound;
59+
@JsonIgnore public long start;
60+
@JsonIgnore public long maxScore;
61+
@JsonIgnore public boolean numFoundExact;
62+
@JsonIgnore public String name;
6063
}

src/testintegration/java/com/synapticloop/integration/test/facet/range/DateRangeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class DateRangeTest extends TestBase {
4141
@Test public void testDefault() throws Exception {
4242
Root root = mapper.readValue(new URL(BASE_URL), Root.class);
4343
assertFalse(root.error);
44-
assertEquals(1000L, root.response.numFound);
44+
assertEquals(1000L, root.panl.pagination.num_results);
4545

4646
// now test the adding and removing - there is only one
4747
DateRangeFacet dateRangeFacet = root.panl.available.date_range_facets[0];

src/testintegration/java/com/synapticloop/integration/test/facet/range/RangeTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class RangeTest extends TestBase {
4747
@Test public void testDefault() throws Exception {
4848
Root root = mapper.readValue(new URL(BASE_URL), Root.class);
4949
assertFalse(root.error);
50-
assertEquals(55L, root.response.numFound);
50+
assertEquals(55L, root.panl.pagination.num_results);
5151

5252
// now test the adding and removing - there is only one
5353
RangeFacet rangeFacet = root.panl.available.range_facets[0];
@@ -65,7 +65,7 @@ public class RangeTest extends TestBase {
6565
// first up test the min and max value replacement
6666
root = mapper.readValue(new URL(BASE_URL + beforeMinValue + during + afterMaxValue), Root.class);
6767
assertFalse(root.error);
68-
assertEquals(55L, root.response.numFound);
68+
assertEquals(55L, root.panl.pagination.num_results);
6969
assertEquals(1, root.panl.active.facet.length);
7070

7171
assertEquals("from%20light%20to%20heavy%20pencils", root.panl.active.facet[0].encoded);
@@ -75,7 +75,7 @@ public class RangeTest extends TestBase {
7575
// Now test to ensure that min and max value replacements are made
7676
root = mapper.readValue(new URL(BASE_URL + before + min + during + max + after), Root.class);
7777
assertFalse(root.error);
78-
assertEquals(55L, root.response.numFound);
78+
assertEquals(55L, root.panl.pagination.num_results);
7979
assertEquals(1, root.panl.active.facet.length);
8080

8181
assertEquals("from%20light%20to%20heavy%20pencils", root.panl.active.facet[0].encoded);
@@ -84,7 +84,7 @@ public class RangeTest extends TestBase {
8484

8585
root = mapper.readValue(new URL(BASE_URL + before + (min + 1) + during + (max - 1) + after), Root.class);
8686
assertFalse(root.error);
87-
assertEquals(48L, root.response.numFound);
87+
assertEquals(48L, root.panl.pagination.num_results);
8888
assertEquals(1, root.panl.active.facet.length);
8989

9090
assertEquals("weighing%20from%20" + (min + 1) + "%20grams%20to%20" + (max-1) +"%20grams", root.panl.active.facet[0].encoded);

0 commit comments

Comments
 (0)