Add InvocationID to p_mdc field in audit logs
[sdc.git] / openecomp-be / lib / openecomp-sdc-logging-lib / openecomp-sdc-logging-core / src / test / java / org / openecomp / sdc / logging / slf4j / SLF4JLoggerWrapperTest.java
index 2b98fc8..6785c15 100644 (file)
@@ -220,6 +220,13 @@ public class SLF4JLoggerWrapperTest {
         assertNull(spy.mdc().get(MetricsField.CLIENT_IP_ADDRESS.asKey()));
     }
 
+    @Test
+    public void auditInvocationIdAvailable() {
+        SpyLogger spy = createSpy();
+        new SLF4JLoggerWrapper(spy).auditExit(AuditData.builder().build());
+        assertNotNull(spy.mdc().get(AuditField.INVOCATION_ID.asKey()));
+    }
+
     @Test
     public void metricsTargetEntityAvailableWhenPassed() {
         final String targetEntity = "MetricsTargetEntity";