Skip to content

Commit ad576e9

Browse files
author
Piotr Bugara
committed
#807 JsonPointer double slashes validation
1 parent f1bf677 commit ad576e9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/test/java/com/github/fge/jsonpatch/JsonPathParserTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
import org.testng.annotations.Test;
44

5-
import static org.assertj.core.api.Assertions.assertThatThrownBy;
6-
import static org.testng.Assert.*;
5+
import static org.testng.Assert.assertEquals;
76

87
public class JsonPathParserTest {
98

@@ -52,4 +51,10 @@ public void shouldThrowExceptionWhenDoubleSlashesInJsonPointerPath() throws Json
5251
String filterQuery = "/characteristic/0//age";
5352
JsonPathParser.tmfStringToJsonPath(filterQuery);
5453
}
54+
55+
@Test(expectedExceptions = JsonPatchException.class)
56+
public void shouldThrowExceptionWhenQuestionMarkInJsonPointerPath() throws JsonPatchException {
57+
String filterQuery = "/characteristic/0/age?";
58+
JsonPathParser.tmfStringToJsonPath(filterQuery);
59+
}
5560
}

0 commit comments

Comments
 (0)