From e70e2318753cf6217fd809c4b9c9e4e8ce5d0da3 Mon Sep 17 00:00:00 2001 From: vempo Date: Mon, 5 Mar 2018 20:55:58 +0200 Subject: Changes to the audit logging implementation Changes to the API and implementation, fixed issues, added javadoc and unit tests, changed scope of some dependencies to "provided" to prevent transitive when not needed. Change-Id: Ib76ae2f921846c2115fcc5cc61b93625307a7c65 Issue-ID: SDC-772 Signed-off-by: vempo --- .../org/openecomp/sdc/logging/api/AuditData.java | 190 ++++++++++++++++++--- .../org/openecomp/sdc/logging/api/StatusCode.java | 27 +++ .../openecomp/sdc/logging/api/AuditDataTest.java | 59 +++++++ .../sdc/logging/api/LoggerFactoryTest.java | 2 +- .../openecomp/sdc/logging/api/SpyAuditData.java | 63 ------- 5 files changed, 258 insertions(+), 83 deletions(-) create mode 100644 openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/StatusCode.java create mode 100644 openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/AuditDataTest.java delete mode 100644 openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/test/java/org/openecomp/sdc/logging/api/SpyAuditData.java (limited to 'openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api') diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/AuditData.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/AuditData.java index 7292762474..fdef45a57f 100644 --- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/AuditData.java +++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/AuditData.java @@ -17,34 +17,186 @@ package org.openecomp.sdc.logging.api; /** - * @author KATYR + * Builder to populate audit data for logging according to + * calledMethods = new HashSet<>(); - - @Override - public long getStartTime() { - calledMethods.add("getStartTime"); - return 0; - } - - @Override - public long getEndTime() { - calledMethods.add("getEndTime"); - return 0; - } - - @Override - public AuditData.StatusCode getStatusCode() { - calledMethods.add("getEndTime"); - return null; - } - - @Override - public String getResponseCode() { - calledMethods.add("getResponseCode"); - return null; - } - - @Override - public String getResponseDescription() { - calledMethods.add("getResponseDescription"); - return null; - } - - @Override - public String getClientIpAddress() { - calledMethods.add("getClientIpAddress"); - return null; - } - - public boolean wasCalled(String method) { - return calledMethods.contains(method); - } -} -- cgit 1.2.3-korg