diff options
author | sharath reddy <bs.reddy@huawei.com> | 2022-03-23 21:22:21 +0530 |
---|---|---|
committer | sharath reddy <bs.reddy@huawei.com> | 2022-03-23 21:29:38 +0530 |
commit | f439543779cf2dfac0b68443aea921c55983bf48 (patch) | |
tree | 74dee9739cd3e202b8a85360d5399a0cb1f2fc23 /validate/sample-mock-generator | |
parent | 9df5c4d3e3e7b72b54de212a4a97ef18e5930948 (diff) |
Fixed Minor Code Smells issues "Deprecated JsonParser"
Issue-ID: CLI-439
Signed-off-by: sharath reddy <bs.reddy@huawei.com>
Change-Id: I49fdc2fe1aa48ae78317aba94fdd7f0232334860
Signed-off-by: sharath reddy <bs.reddy@huawei.com>
Diffstat (limited to 'validate/sample-mock-generator')
-rw-r--r-- | validate/sample-mock-generator/src/main/java/org/onap/cli/http/mock/MockRequest.java | 5 | ||||
-rw-r--r-- | validate/sample-mock-generator/src/main/java/org/onap/cli/http/mock/MockResponse.java | 5 |
2 files changed, 4 insertions, 6 deletions
diff --git a/validate/sample-mock-generator/src/main/java/org/onap/cli/http/mock/MockRequest.java b/validate/sample-mock-generator/src/main/java/org/onap/cli/http/mock/MockRequest.java index 7b3e5738..1a70be35 100644 --- a/validate/sample-mock-generator/src/main/java/org/onap/cli/http/mock/MockRequest.java +++ b/validate/sample-mock-generator/src/main/java/org/onap/cli/http/mock/MockRequest.java @@ -61,10 +61,9 @@ public class MockRequest { public void setJson(String json) throws IOException { //NOSONAR if (!json.isEmpty()) { try { - JsonParser parser = new JsonParser(); - this.json = parser.parse(json); + this.json = JsonParser.parseString(json); } catch (Exception e) { - this.json = new JsonParser().parse("{}"); + this.json = JsonParser.parseString("{}"); } } diff --git a/validate/sample-mock-generator/src/main/java/org/onap/cli/http/mock/MockResponse.java b/validate/sample-mock-generator/src/main/java/org/onap/cli/http/mock/MockResponse.java index 7f605c33..fedfb02a 100644 --- a/validate/sample-mock-generator/src/main/java/org/onap/cli/http/mock/MockResponse.java +++ b/validate/sample-mock-generator/src/main/java/org/onap/cli/http/mock/MockResponse.java @@ -39,10 +39,9 @@ public class MockResponse { public void setJson(String json) throws IOException { //NOSONAR if (json != null && !json.isEmpty()) { try { - JsonParser parser = new JsonParser(); - this.json = parser.parse(json); + this.json = JsonParser.parseString(json); } catch (Exception e) { - this.json = new JsonParser().parse("{}"); + this.json = JsonParser.parseString("{}"); } } } |