summaryrefslogtreecommitdiffstats
path: root/aai-core/src
diff options
context:
space:
mode:
Diffstat (limited to 'aai-core/src')
-rw-r--r--aai-core/src/main/java/org/onap/aai/logging/LoggingContext.java8
-rw-r--r--aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java2
2 files changed, 8 insertions, 2 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/logging/LoggingContext.java b/aai-core/src/main/java/org/onap/aai/logging/LoggingContext.java
index ed332281..627a2f8c 100644
--- a/aai-core/src/main/java/org/onap/aai/logging/LoggingContext.java
+++ b/aai-core/src/main/java/org/onap/aai/logging/LoggingContext.java
@@ -32,6 +32,7 @@ import java.util.concurrent.TimeUnit;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
+import org.onap.aai.exceptions.AAIException;
import org.slf4j.MDC;
import com.att.eelf.configuration.EELFLogger;
@@ -114,7 +115,12 @@ public class LoggingContext {
MDC.put(LoggingField.REQUEST_ID.toString(), requestId.toString());
}
- public static void requestId(String requestId) {
+ public static void requestId(String requestId) throws AAIException {
+
+ if(requestId == null){
+ throw new AAIException("AAI_4010");
+ }
+
try {
if (requestId.contains(":")) {
String[] uuidParts = requestId.split(":");
diff --git a/aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java b/aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java
index 46ac5997..7885410d 100644
--- a/aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java
+++ b/aai-core/src/test/java/org/onap/aai/logging/LoggingContextTest.java
@@ -53,7 +53,7 @@ public class LoggingContextTest {
}
@Test
- public void testRequestId() { //AKA Transaction ID
+ public void testRequestId() throws Exception { //AKA Transaction ID
final String sUuid = "57d51eaa-edc6-4f50-a69d-f2d4d2445120";
LoggingContext.requestId(sUuid);