From 4026d98bc9802e41146ff6ef727d349c7ac1e89e Mon Sep 17 00:00:00 2001 From: Jakub Zieba Date: Tue, 4 Sep 2018 07:23:41 +0200 Subject: Add protocols to hosts Add default protocols for Consul hosts Add controller for healt check Fix for merging properties from file and Consul Change-Id: Ifa8c7cdfa333d8ffee175b5eb4446f0c3a986f27 Issue-ID: DCAEGEN2-747 Signed-off-by: Jakub Zieba --- .../java/org/onap/dcae/vestest/TestVESLogger.java | 75 +++++++++++----------- 1 file changed, 37 insertions(+), 38 deletions(-) (limited to 'src/test/java/org/onap/dcae/vestest/TestVESLogger.java') diff --git a/src/test/java/org/onap/dcae/vestest/TestVESLogger.java b/src/test/java/org/onap/dcae/vestest/TestVESLogger.java index 484f7dc8..848f2b76 100644 --- a/src/test/java/org/onap/dcae/vestest/TestVESLogger.java +++ b/src/test/java/org/onap/dcae/vestest/TestVESLogger.java @@ -19,57 +19,56 @@ */ package org.onap.dcae.vestest; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNotSame; -import static org.onap.dcae.commonFunction.VESLogger.REQUEST_ID; - import com.att.nsa.logging.LoggingContext; import com.att.nsa.logging.log4j.EcompFields; -import java.util.UUID; import org.junit.Test; import org.onap.dcae.commonFunction.VESLogger; +import java.util.UUID; + +import static org.junit.Assert.*; +import static org.onap.dcae.commonFunction.VESLogger.REQUEST_ID; + public class TestVESLogger { - @Test - public void shouldOnLoggingContextInitializationPutRandomUUIDAsRequestID() { - LoggingContext commonLoggingContext = VESLogger.getCommonLoggingContext(); - String requestId = commonLoggingContext.get(REQUEST_ID, "default"); + @Test + public void shouldOnLoggingContextInitializationPutRandomUuidAsRequestId() { + LoggingContext commonLoggingContext = VESLogger.getCommonLoggingContext(); + String requestId = commonLoggingContext.get(REQUEST_ID, "default"); - assertNotNull(requestId); - assertNotSame(requestId, "default"); + assertNotNull(requestId); + assertNotSame(requestId, "default"); - } + } - @Test - public void shouldOnLoggingContextInitializationPutGivenUUIDAsRequestIDAndSupplyEndTimestamp() { - final UUID uuid = UUID.randomUUID(); - LoggingContext loggingContextForThread = VESLogger.getLoggingContextForThread(uuid); - String requestId = loggingContextForThread.get(REQUEST_ID, "default"); - String endTimestamp = loggingContextForThread.get(EcompFields.kEndTimestamp, "default"); + @Test + public void shouldOnLoggingContextInitializationPutGivenUuuidAsRequestIdAndSupplyEndTimestamp() { + final UUID uuid = UUID.randomUUID(); + LoggingContext loggingContextForThread = VESLogger.getLoggingContextForThread(uuid); + String requestId = loggingContextForThread.get(REQUEST_ID, "default"); + String endTimestamp = loggingContextForThread.get(EcompFields.kEndTimestamp, "default"); - assertNotNull(requestId); - assertNotNull(endTimestamp); - assertNotSame(endTimestamp, "default"); - assertEquals(requestId, uuid.toString()); - } + assertNotNull(requestId); + assertNotNull(endTimestamp); + assertNotSame(endTimestamp, "default"); + assertEquals(requestId, uuid.toString()); + } - @Test - public void shouldOnLoggingContextInitializationPutGivenUUIDAsRequestIDAndSupplyEndTimestampAndCompleteStatusCode() { - final UUID uuid = UUID.randomUUID(); - LoggingContext loggingContextForThread = VESLogger.getLoggingContextForThread(uuid.toString()); - String requestId = loggingContextForThread.get(REQUEST_ID, "default"); - String statusCode = loggingContextForThread.get("statusCode", "default"); - String endTimestamp = loggingContextForThread.get(EcompFields.kEndTimestamp, "default"); + @Test + public void shouldOnLoggingContextInitializationPutGivenUuidAsRequestIdAndSupplyEndTimestampAndCompleteStatusCode() { + final UUID uuid = UUID.randomUUID(); + LoggingContext loggingContextForThread = VESLogger.getLoggingContextForThread(uuid.toString()); + String requestId = loggingContextForThread.get(REQUEST_ID, "default"); + String statusCode = loggingContextForThread.get("statusCode", "default"); + String endTimestamp = loggingContextForThread.get(EcompFields.kEndTimestamp, "default"); - assertNotNull(requestId); - assertNotNull(endTimestamp); - assertNotNull(statusCode); - assertNotSame(endTimestamp, "default"); - assertEquals(requestId, uuid.toString()); - assertEquals(statusCode, "COMPLETE"); - } + assertNotNull(requestId); + assertNotNull(endTimestamp); + assertNotNull(statusCode); + assertNotSame(endTimestamp, "default"); + assertEquals(requestId, uuid.toString()); + assertEquals(statusCode, "COMPLETE"); + } } -- cgit 1.2.3-korg