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<>();