From 7db579a2da7d6a9dc066461067c2e1ce713f2133 Mon Sep 17 00:00:00 2001
From: Piotr Borelowski
Date: Fri, 7 Jun 2019 10:37:34 +0200
Subject: Renamed the field 'statusCode'
Removing the sonar issues in the package
org.onap.sdc.common.onaplog.enums
Issue-ID: SDC-2327
Signed-off-by: Piotr Borelowski
Change-Id: I713e9fdebe8cdccf9785af3882448aa113bb3c49
---
.../java/org/onap/sdc/common/onaplog/Enums/StatusCode.java | 10 ++++++----
src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java | 3 ++-
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java b/src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java
index da645a9..05bbbb7 100644
--- a/src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java
+++ b/src/main/java/org/onap/sdc/common/onaplog/Enums/StatusCode.java
@@ -4,11 +4,13 @@ public enum StatusCode {
ERROR("ERROR"),
COMPLETE("COMPLETE");
- String statusCode;
+ private String text;
- StatusCode(String statusCode){this.statusCode = statusCode;}
+ StatusCode(String text) {
+ this.text = text;
+ }
- public String getStatusCodeEnum(){
- return statusCode;
+ public String getText() {
+ return text;
}
}
diff --git a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java
index d4cc26d..787b377 100644
--- a/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java
+++ b/src/main/java/org/onap/sdc/common/onaplog/OnapLoggerAudit.java
@@ -106,7 +106,8 @@ public class OnapLoggerAudit extends OnapLoggerBase {
public OnapLoggerAudit setStatusCode(String statusCode) {
// status code is either success (COMPLETE) or failure (ERROR) of the request.
- String respStatus = Integer.parseInt(statusCode) / 100 == 2 ? StatusCode.COMPLETE.getStatusCodeEnum() : StatusCode.ERROR.getStatusCodeEnum();
+ String respStatus = Integer.parseInt(statusCode) / 100 == 2 ?
+ StatusCode.COMPLETE.getText() : StatusCode.ERROR.getText();
onapMDCWrapper.setStatusCode(respStatus);
return this;
}
--
cgit 1.2.3-korg