diff options
Diffstat (limited to 'feature-state-management/src/main/java')
2 files changed, 7 insertions, 2 deletions
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java index efecf887..cde6e4e4 100644 --- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java +++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DbAudit.java @@ -43,6 +43,8 @@ public class DbAudit extends DroolsPDPIntegrityMonitor.AuditBase // This indicates if 'CREATE TABLE IF NOT EXISTS Audit ...' should be // 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; @@ -50,7 +52,7 @@ public class DbAudit extends DroolsPDPIntegrityMonitor.AuditBase /** * @return the single 'DbAudit' instance */ - static DroolsPDPIntegrityMonitor.AuditBase getInstance() + public static DroolsPDPIntegrityMonitor.AuditBase getInstance() { return(instance); } @@ -74,6 +76,9 @@ public class DbAudit extends DroolsPDPIntegrityMonitor.AuditBase if(logger.isDebugEnabled()){ logger.debug("Running 'DbAudit.invoke'"); } + if(isJunit){ + createTableNeeded = false; + } boolean isActive = true; String dbAuditIsActive = StateManagementProperties.getProperty("db.audit.is.active"); if(logger.isDebugEnabled()){ diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java index 7eed736e..b36c1657 100644 --- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java +++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java @@ -51,7 +51,7 @@ public class RepositoryAudit extends DroolsPDPIntegrityMonitor.AuditBase /** * @return the single 'RepositoryAudit' instance */ - static DroolsPDPIntegrityMonitor.AuditBase getInstance() + public static DroolsPDPIntegrityMonitor.AuditBase getInstance() { return instance; } |