summaryrefslogtreecommitdiffstats
path: root/security-utils/src/test/java/com/yahoo/security/tls/https/VespaHttpClientBuilderTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'security-utils/src/test/java/com/yahoo/security/tls/https/VespaHttpClientBuilderTest.java')
-rw-r--r--security-utils/src/test/java/com/yahoo/security/tls/https/VespaHttpClientBuilderTest.java39
1 files changed, 0 insertions, 39 deletions
diff --git a/security-utils/src/test/java/com/yahoo/security/tls/https/VespaHttpClientBuilderTest.java b/security-utils/src/test/java/com/yahoo/security/tls/https/VespaHttpClientBuilderTest.java
deleted file mode 100644
index 10b8458359c..00000000000
--- a/security-utils/src/test/java/com/yahoo/security/tls/https/VespaHttpClientBuilderTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.security.tls.https;
-
-import com.yahoo.security.tls.https.VespaHttpClientBuilder.HttpToHttpsRewritingRequestInterceptor;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.protocol.BasicHttpContext;
-import org.junit.Test;
-
-import java.net.URI;
-
-import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
-
-/**
- * @author bjorncs
- */
-public class VespaHttpClientBuilderTest {
-
- @Test
- public void request_interceptor_modifies_scheme_of_requests() {
- verifyProcessedUriMatchesExpectedOutput("http://dummyhostname:8080/a/path/to/resource?query=value",
- "https://dummyhostname:8080/a/path/to/resource?query=value");
- }
-
- @Test
- public void request_interceptor_add_handles_implicit_http_port() {
- verifyProcessedUriMatchesExpectedOutput("http://dummyhostname/a/path/to/resource?query=value",
- "https://dummyhostname:80/a/path/to/resource?query=value");
- }
-
- private static void verifyProcessedUriMatchesExpectedOutput(String inputUri, String expectedOutputUri) {
- var interceptor = new HttpToHttpsRewritingRequestInterceptor();
- HttpGet request = new HttpGet(inputUri);
- interceptor.process(request, new BasicHttpContext());
- URI modifiedUri = request.getURI();
- URI expectedUri = URI.create(expectedOutputUri);
- assertThat(modifiedUri).isEqualTo(expectedUri);
- }
-
-} \ No newline at end of file