From 01a7917f0e1323d2c8c94b0ffa1f7c71d673a9d5 Mon Sep 17 00:00:00 2001 From: Avishka-Shamendra Date: Mon, 23 Sep 2024 08:56:17 +0530 Subject: [PATCH] Improve variable naming --- .../am/integration/tests/restapi/ContentSearchTestCase.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/restapi/ContentSearchTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/restapi/ContentSearchTestCase.java index d15bcd7471..d2487ac180 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/restapi/ContentSearchTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/restapi/ContentSearchTestCase.java @@ -242,8 +242,7 @@ public void testDocumentContentSearch() throws Exception { public void testContentSearchWithAccessControl() throws Exception { // Set API publisher access control to role1 HttpResponse httpResponse = restAPIPublisher.getAPI(apiId); - Gson g = new Gson(); - APIDTO apiDto = g.fromJson(httpResponse.getData(), APIDTO.class); + APIDTO apiDto = new Gson().fromJson(httpResponse.getData(), APIDTO.class); apiDto.setAccessControl(APIDTO.AccessControlEnum.RESTRICTED); List roles = new ArrayList<>(); @@ -310,8 +309,7 @@ public void testContentSearchWithStoreVisibility() throws Exception { // Set store visibility to role1 HttpResponse httpResponse = restAPIPublisher.getAPI(apiId); - Gson g = new Gson(); - APIDTO apiDto = g.fromJson(httpResponse.getData(), APIDTO.class); + APIDTO apiDto = new Gson().fromJson(httpResponse.getData(), APIDTO.class); apiDto.setAccessControl(APIDTO.AccessControlEnum.NONE); List roles = new ArrayList<>();