-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
core/src/test/java/com/alibaba/fastjson2/issues_1800/Issue1862.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.alibaba.fastjson2.issues_1800; | ||
|
||
import com.alibaba.fastjson2.JSONObject; | ||
import com.alibaba.fastjson2.JSONPath; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class Issue1862 { | ||
@Test | ||
public void test() { | ||
String str = "{\"custom\":{},\"uePolicySet\":{\"vendorSpecific-000111\":{\"consumerAttrs\":{\"blobValue\":{\"DataOpt\":\"nidhi123\",\"Entitlements\":[\"ALL-IN\",\"OCS-SY\"],\"BillingPlanCode\":\"5GL03\",\"4GPFO\":\"DPRDTL\",\"5GPFO\":\"5GSPDTL\"}}}}}\n"; | ||
|
||
String configuredPath = "uePolicySet[\"vendorSpecific-000111\"].consumerAttrs.blobValue"; | ||
JSONObject jsonObject = (JSONObject) JSONPath.extract(str, configuredPath); | ||
assertEquals( | ||
"{\"DataOpt\":\"nidhi123\",\"Entitlements\":[\"ALL-IN\",\"OCS-SY\"],\"BillingPlanCode\":\"5GL03\",\"4GPFO\":\"DPRDTL\",\"5GPFO\":\"5GSPDTL\"}", | ||
jsonObject.toString() | ||
); | ||
} | ||
} |