@@ -10,51 +10,51 @@ public class JsonPathParserTest {
10
10
public void shouldConvertPointerToJsonPath () throws JsonPatchException {
11
11
String jsonPointerWithQuery = "/productPrice/prodPriceAlteration" ;
12
12
String expected = "$.productPrice.prodPriceAlteration" ;
13
- String result = JsonPathParser .tmfStringToJsonPath (jsonPointerWithQuery );
13
+ String result = JsonPathParser .parsePathToJsonPath (jsonPointerWithQuery );
14
14
assertEquals (result , expected );
15
15
}
16
16
17
17
@ Test
18
18
public void shouldConvertPointerWithArrayToJsonPath () throws JsonPatchException {
19
19
String jsonPointerWithQuery = "/productPrice/1/prodPriceAlteration" ;
20
20
String expected = "$.productPrice.[1].prodPriceAlteration" ;
21
- String result = JsonPathParser .tmfStringToJsonPath (jsonPointerWithQuery );
21
+ String result = JsonPathParser .parsePathToJsonPath (jsonPointerWithQuery );
22
22
assertEquals (result , expected );
23
23
}
24
24
25
25
@ Test
26
26
public void shouldConvertPointerWithArrayAtTheEndToJsonPath () throws JsonPatchException {
27
27
String jsonPointerWithQuery = "/productPrice/prodPriceAlteration/1" ;
28
28
String expected = "$.productPrice.prodPriceAlteration.[1]" ;
29
- String result = JsonPathParser .tmfStringToJsonPath (jsonPointerWithQuery );
29
+ String result = JsonPathParser .parsePathToJsonPath (jsonPointerWithQuery );
30
30
assertEquals (result , expected );
31
31
}
32
32
33
33
@ Test
34
34
public void shouldConvertArrayPathToJsonPath () throws JsonPatchException {
35
35
String jsonPointer = "/2/1/-" ;
36
36
String expected = "$.[2].[1].-" ;
37
- String result = JsonPathParser .tmfStringToJsonPath (jsonPointer );
37
+ String result = JsonPathParser .parsePathToJsonPath (jsonPointer );
38
38
assertEquals (result , expected );
39
39
}
40
40
41
41
@ Test
42
42
public void shouldLeaveJsonPathStatementsUntouched () throws JsonPatchException {
43
43
String filterQuery = "$.arrayPath[?(@.innerArray[?(@.nestedVal=='as')] empty false)].innerArray[?(@.nestedVal=='df')].name" ;
44
44
String expected = "$.arrayPath[?(@.innerArray[?(@.nestedVal=='as')] empty false)].innerArray[?(@.nestedVal=='df')].name" ;
45
- String result = JsonPathParser .tmfStringToJsonPath (filterQuery );
45
+ String result = JsonPathParser .parsePathToJsonPath (filterQuery );
46
46
assertEquals (result , expected );
47
47
}
48
48
49
49
@ Test (expectedExceptions = JsonPatchException .class , expectedExceptionsMessageRegExp = "Invalid path, `//` is not allowed in JsonPointer expressions." )
50
50
public void shouldThrowExceptionWhenDoubleSlashesInJsonPointerPath () throws JsonPatchException {
51
51
String filterQuery = "/characteristic/0//age" ;
52
- JsonPathParser .tmfStringToJsonPath (filterQuery );
52
+ JsonPathParser .parsePathToJsonPath (filterQuery );
53
53
}
54
54
55
55
@ Test (expectedExceptions = JsonPatchException .class )
56
56
public void shouldThrowExceptionWhenQuestionMarkInJsonPointerPath () throws JsonPatchException {
57
57
String filterQuery = "/characteristic/0/age?" ;
58
- JsonPathParser .tmfStringToJsonPath (filterQuery );
58
+ JsonPathParser .parsePathToJsonPath (filterQuery );
59
59
}
60
60
}
0 commit comments