SonarCube Critical Issue 09/16109/1
authorKevin McKiou <km097d@att.com>
Wed, 27 Sep 2017 21:06:33 +0000 (16:06 -0500)
committerKevin McKiou <km097d@att.com>
Wed, 27 Sep 2017 21:07:00 +0000 (16:07 -0500)
Patch 1: Modifying DbAudit to access isJunit variable
to, hopefully, satisfy SonarCube on a critical issue.

Issue-ID: POLICY-261
Change-Id: Ibc1a2876bdf08377798c503110b05e79a0986c38
Signed-off-by: Kevin McKiou <km097d@att.com>
feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java
feature-state-management/src/test/java/org/onap/policy/drools/statemanagement/test/StateManagementTest.java

index cde6e4e..b2830e8 100644 (file)
@@ -44,11 +44,21 @@ public class DbAudit extends DroolsPDPIntegrityMonitor.AuditBase
   // invoked -- doing this avoids the need to create the table in advance.
   static private boolean createTableNeeded = true;
   
-  static public boolean isJunit = false;
-
   synchronized private static void setCreateTableNeeded(boolean b) {
                DbAudit.createTableNeeded = b;
-       }
+  }
+  
+  static private boolean isJunit = false;
+  
+  synchronized public static void setIsJunit(boolean b) {
+               DbAudit.isJunit = b;
+  }
+  
+  public static boolean isJunit(){
+         return DbAudit.isJunit;
+  }
+  
+  
   /**
    * @return the single 'DbAudit' instance
    */
index ba7ce3e..6f2a0e2 100644 (file)
@@ -110,7 +110,7 @@ public class StateManagementTest {
 
                String configDir = "src/test/resources";
                
-               DbAudit.isJunit = true;
+               DbAudit.setIsJunit(true);
                
                Properties fsmProperties = new Properties();
                fsmProperties.load(new FileInputStream(new File(