From: Suresh Charan Date: Fri, 24 Feb 2023 19:47:02 +0000 (-0500) Subject: Fixed sonar issues in xacml-pdp X-Git-Tag: 2.8.1~2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=acfc48f09d52f9559f2d49591e82ff0eada21aa7;p=policy%2Fxacml-pdp.git Fixed sonar issues in xacml-pdp Reduced technical debt Issue-ID: POLICY-4536 Change-Id: I2d345cc879dbd267b4a2c0791aae153db994114b Signed-off-by: Suresh Charan --- diff --git a/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java b/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java index d8dc2ee3..a1f1b8a7 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2019, 2021-2022 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2021 Nordix Foundation. + * Modifications Copyright (C) 2023 Bell Canada. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -133,14 +134,14 @@ public class XacmlStateTest { publisher.handlePdpUpdate(message); PdpStatistics stats = state.getStatistics(); - assertTrue(stats != null); + assertNotNull(stats); assertEquals(GROUP, stats.getPdpGroupName()); - assertEquals(stats.getPolicyDeployCount(), 1); - assertEquals(stats.getPolicyDeploySuccessCount(), 1); - assertEquals(stats.getPolicyDeployFailCount(), 0); - assertEquals(stats.getPolicyUndeployCount(), 1); - assertEquals(stats.getPolicyUndeployFailCount(), 1); - assertEquals(stats.getPolicyUndeploySuccessCount(), 0); + assertEquals(1, stats.getPolicyDeployCount()); + assertEquals(1, stats.getPolicyDeploySuccessCount()); + assertEquals(0, stats.getPolicyDeployFailCount()); + assertEquals(1, stats.getPolicyUndeployCount()); + assertEquals(1, stats.getPolicyUndeployFailCount()); + assertEquals(0, stats.getPolicyUndeploySuccessCount()); PdpStatistics test = new PdpStatistics(); test.setTimeStamp(stats.getTimeStamp());