|
|
@ -38,8 +38,8 @@ public class ArraySlicingTest { |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void get_by_position(){ |
|
|
|
public void get_by_position(){ |
|
|
|
int result = JsonPath.read(JSON_ARRAY, "$[3]"); |
|
|
|
Integer result = JsonPath.read(JSON_ARRAY, "$[3]"); |
|
|
|
assertEquals(7, result); |
|
|
|
assertEquals(7, result.intValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
@ -76,14 +76,14 @@ public class ArraySlicingTest { |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void get_from_tail(){ |
|
|
|
public void get_from_tail(){ |
|
|
|
int result = JsonPath.read(JSON_ARRAY, "$[3:]"); |
|
|
|
Integer result = JsonPath.read(JSON_ARRAY, "$[3:]"); |
|
|
|
assertEquals(8, result); |
|
|
|
assertEquals(8, result.intValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void get_from_tail_length(){ |
|
|
|
public void get_from_tail_length(){ |
|
|
|
int result = JsonPath.read(JSON_ARRAY, "$[(@.length -3)]"); |
|
|
|
Integer result = JsonPath.read(JSON_ARRAY, "$[(@.length -3)]"); |
|
|
|
assertEquals(8, result); |
|
|
|
assertEquals(8, result.intValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|