You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
705 B
31 lines
705 B
14 years ago
|
package com.jayway.jsonpath;
|
||
|
|
||
|
import org.junit.Test;
|
||
|
|
||
|
import static org.junit.Assert.assertFalse;
|
||
14 years ago
|
import static org.junit.Assert.assertTrue;
|
||
14 years ago
|
|
||
|
/**
|
||
|
* Created by IntelliJ IDEA.
|
||
|
* User: kallestenflo
|
||
|
* Date: 2/3/11
|
||
|
* Time: 9:58 PM
|
||
|
*/
|
||
14 years ago
|
public class IsDefinitePathTest {
|
||
14 years ago
|
|
||
|
|
||
|
@Test
|
||
14 years ago
|
public void path_is_not_definite() throws Exception {
|
||
14 years ago
|
assertFalse(JsonPath.compile("$..book[0]").isPathDefinite());
|
||
|
assertFalse(JsonPath.compile("$.books[*]").isPathDefinite());
|
||
14 years ago
|
}
|
||
|
|
||
14 years ago
|
@Test
|
||
14 years ago
|
public void path_is_definite() throws Exception {
|
||
14 years ago
|
assertTrue(JsonPath.compile("$.definite.this.is").isPathDefinite());
|
||
|
assertTrue(JsonPath.compile("rows[0].id").isPathDefinite());
|
||
14 years ago
|
}
|
||
|
|
||
14 years ago
|
|
||
|
}
|