3
3
import static org .junit .Assert .assertEquals ;
4
4
import static org .junit .Assert .assertTrue ;
5
5
import static org .junit .Assume .assumeTrue ;
6
-
7
6
import com .fasterxml .jackson .databind .JsonNode ;
8
7
import com .fasterxml .jackson .databind .node .JsonNodeType ;
9
8
import java .io .IOException ;
@@ -230,7 +229,7 @@ public void getElementsCountRatioTest() {
230
229
+ "addr:housenumber=*" ,
231
230
JsonNode .class );
232
231
assertEquals (expectedValue ,
233
- response .getBody ().get ("ratioResult " ).get (0 ).get ("ratio" ).asDouble (),
232
+ response .getBody ().get ("result " ).get (0 ).get ("ratio" ).asDouble (),
234
233
expectedValue * deltaPercentage );
235
234
}
236
235
@@ -246,10 +245,10 @@ public void getElementsCountRatioGroupByBoundaryTest() {
246
245
assertEquals (expectedValue , StreamSupport
247
246
.stream (
248
247
Spliterators .spliteratorUnknownSize (
249
- response .getBody ().get ("groupByBoundaryResult " ).iterator (), Spliterator .ORDERED ),
248
+ response .getBody ().get ("groupByResult " ).iterator (), Spliterator .ORDERED ),
250
249
false )
251
250
.filter (jsonNode -> jsonNode .get ("groupByObject" ).asText ().equalsIgnoreCase ("boundary1" ))
252
- .findFirst ().get ().get ("ratioResult " ).get (0 ).get ("ratio" ).asDouble (),
251
+ .findFirst ().get ().get ("result " ).get (0 ).get ("ratio" ).asDouble (),
253
252
expectedValue * deltaPercentage );
254
253
}
255
254
@@ -438,7 +437,7 @@ public void getElementsLengthRatioTest() {
438
437
+ "&time=2011-12-13&&filter=type:way and highway=*&filter2=railway=*" ,
439
438
JsonNode .class );
440
439
assertEquals (expectedValue ,
441
- response .getBody ().get ("ratioResult " ).get (0 ).get ("ratio" ).asDouble (),
440
+ response .getBody ().get ("result " ).get (0 ).get ("ratio" ).asDouble (),
442
441
expectedValue * deltaPercentage );
443
442
}
444
443
@@ -454,10 +453,10 @@ public void getElementsLengthRatioGroupByBoundaryTest() {
454
453
assertEquals (expectedValue , StreamSupport
455
454
.stream (
456
455
Spliterators .spliteratorUnknownSize (
457
- response .getBody ().get ("groupByBoundaryResult " ).iterator (), Spliterator .ORDERED ),
456
+ response .getBody ().get ("groupByResult " ).iterator (), Spliterator .ORDERED ),
458
457
false )
459
458
.filter (jsonNode -> jsonNode .get ("groupByObject" ).asText ().equalsIgnoreCase ("boundary1" ))
460
- .findFirst ().get ().get ("ratioResult " ).get (0 ).get ("ratio" ).asDouble (),
459
+ .findFirst ().get ().get ("result " ).get (0 ).get ("ratio" ).asDouble (),
461
460
expectedValue * deltaPercentage );
462
461
}
463
462
@@ -1086,7 +1085,7 @@ public void areaRatioFilterTest() {
1086
1085
+ "2018-01-01&filter=building=* and type:way&filter2=building=* and type:relation" ,
1087
1086
JsonNode .class );
1088
1087
assertEquals (expectedValue ,
1089
- response .getBody ().get ("ratioResult " ).get (0 ).get ("ratio" ).asDouble (),
1088
+ response .getBody ().get ("result " ).get (0 ).get ("ratio" ).asDouble (),
1090
1089
expectedValue * deltaPercentage );
1091
1090
}
1092
1091
@@ -1102,10 +1101,10 @@ public void ratioGroupByBoundaryFilterTest() {
1102
1101
assertEquals (expectedValue , StreamSupport
1103
1102
.stream (
1104
1103
Spliterators .spliteratorUnknownSize (
1105
- response .getBody ().get ("groupByBoundaryResult " ).iterator (), Spliterator .ORDERED ),
1104
+ response .getBody ().get ("groupByResult " ).iterator (), Spliterator .ORDERED ),
1106
1105
false )
1107
1106
.filter (jsonNode -> jsonNode .get ("groupByObject" ).asText ().equalsIgnoreCase ("b2" ))
1108
- .findFirst ().get ().get ("ratioResult " ).get (0 ).get ("ratio" ).asDouble (),
1107
+ .findFirst ().get ().get ("result " ).get (0 ).get ("ratio" ).asDouble (),
1109
1108
expectedValue * deltaPercentage );
1110
1109
}
1111
1110
@@ -1118,7 +1117,7 @@ public void getElementsCountRatioEmptyFilterTest() {
1118
1117
+ "filter2=highway=*&time=2019-01-01" ,
1119
1118
JsonNode .class );
1120
1119
assertEquals (expectedValue ,
1121
- response .getBody ().get ("ratioResult " ).get (0 ).get ("ratio" ).asDouble (),
1120
+ response .getBody ().get ("result " ).get (0 ).get ("ratio" ).asDouble (),
1122
1121
expectedValue * deltaPercentage );
1123
1122
}
1124
1123
0 commit comments