summaryrefslogtreecommitdiffstats
path: root/jdisc_http_service/src/test/java/com/yahoo/container/logging/JsonConnectionLogWriterTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'jdisc_http_service/src/test/java/com/yahoo/container/logging/JsonConnectionLogWriterTest.java')
-rw-r--r--jdisc_http_service/src/test/java/com/yahoo/container/logging/JsonConnectionLogWriterTest.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/jdisc_http_service/src/test/java/com/yahoo/container/logging/JsonConnectionLogWriterTest.java b/jdisc_http_service/src/test/java/com/yahoo/container/logging/JsonConnectionLogWriterTest.java
index b8978fe489c..8944ae9d288 100644
--- a/jdisc_http_service/src/test/java/com/yahoo/container/logging/JsonConnectionLogWriterTest.java
+++ b/jdisc_http_service/src/test/java/com/yahoo/container/logging/JsonConnectionLogWriterTest.java
@@ -1,6 +1,7 @@
package com.yahoo.container.logging;// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
import com.yahoo.test.json.JsonTestHelper;
+import com.yahoo.vespa.jdk8compat.List;
import org.junit.jupiter.api.Test;
import java.io.ByteArrayOutputStream;
@@ -20,12 +21,19 @@ class JsonConnectionLogWriterTest {
var instant = Instant.parse("2021-01-13T12:12:12Z");
ConnectionLogEntry entry = ConnectionLogEntry.builder(id, instant)
.withPeerPort(1234)
+ .withSslHandshakeFailure(new ConnectionLogEntry.SslHandshakeFailure("UNKNOWN",
+ List.of(
+ new ConnectionLogEntry.SslHandshakeFailure.ExceptionEntry("javax.net.ssl.SSLHandshakeException", "message"),
+ new ConnectionLogEntry.SslHandshakeFailure.ExceptionEntry("java.io.IOException", "cause message"))))
.build();
String expectedJson = "{" +
"\"id\":\""+id.toString()+"\"," +
"\"timestamp\":\"2021-01-13T12:12:12Z\"," +
- "\"peerPort\":1234" +
- "}";
+ "\"peerPort\":1234," +
+ "\"ssl\":{\"handshake-failure\":{\"exception\":[" +
+ "{\"cause\":\"javax.net.ssl.SSLHandshakeException\",\"message\":\"message\"}," +
+ "{\"cause\":\"java.io.IOException\",\"message\":\"cause message\"}" +
+ "],\"type\":\"UNKNOWN\"}}}";
JsonConnectionLogWriter writer = new JsonConnectionLogWriter();
ByteArrayOutputStream out = new ByteArrayOutputStream();