diff options
author | Kevin McKiou <km097d@att.com> | 2017-09-22 17:08:15 -0500 |
---|---|---|
committer | Kevin McKiou <km097d@att.com> | 2017-09-25 12:23:16 -0500 |
commit | 2b2d21fd2761ceab9faa50f224b1d136f3b36d34 (patch) | |
tree | c3cd90cebdcfb7e928c9ae739575623ae60f589a /feature-state-management/src/main/java/org | |
parent | fbed3c9c7b816b9fa4dd96dc218a0603b1d1c544 (diff) |
Incr State Mgmt Code Coverage
Patch 1: Added JUnit tests to feature-state-management
to increase coverage. Estimated coverage is now 48%.
Patch 2: Trivial change to force a rebuild. Patch 3:
Tweaking the JUnit to try and account for the difference
between the LF environment and my local environment.
Patch 4: Something caused the policy endpoints JUnits
to fail - unrelated to these changes. Made a trival
change to force a rebuild. Patch 5: Trivial change to
force rebuild. Patch 6: Minor changes in response to
Jorge Hernandez comments.
Issue-ID; POLICY-266
Change-Id: I7979c200ab18d5861ba20e0d5f23bd0083193daa
Signed-off-by: Kevin McKiou <km097d@att.com>
Diffstat (limited to 'feature-state-management/src/main/java/org')
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 a86ac8ef..8de170c7 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,11 +43,13 @@ 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; /** * @return the single 'DbAudit' instance */ - static DroolsPDPIntegrityMonitor.AuditBase getInstance() + public static DroolsPDPIntegrityMonitor.AuditBase getInstance() { return(instance); } @@ -71,6 +73,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 6171572a..94464cd4 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); } |