Skip to content

Commit

Permalink
Use correct ports for MTLS native test
Browse files Browse the repository at this point in the history
Native runs in prod profile and so doesn't use the set test ports,
need to explicitly use the same port as would be used in prod. Currently hardcoded though.

Use different method to include resources, specify all jks rather than using resource file.
  • Loading branch information
CSTDev committed Oct 30, 2019
1 parent e731ec8 commit eca64b8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion integration-tests/vertx-http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<enableHttpUrlHandler>true</enableHttpUrlHandler>
<!-- Include the server certificate -->
<additionalBuildArgs>
<additionalBuildArg>-H:ResourceConfigurationFiles=${project.basedir}/src/main/resources/resources-config.json</additionalBuildArg>
<additionalBuildArg>-H:IncludeResources=.*\.jks</additionalBuildArg>
<additionalBuildArg>-H:EnableURLProtocols=http,https</additionalBuildArg>
</additionalBuildArgs>
<graalvmHome>${graalvmHome}</graalvmHome>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
package io.quarkus.it.vertx;

import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.containsString;

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.NativeImageTest;
import io.restassured.builder.RequestSpecBuilder;
import io.restassured.specification.RequestSpecification;

@NativeImageTest
public class VertxProducerResourceIT extends VertxProducerResourceTest {

}
@Test
public void testRouteRegistrationMTLS() {
RequestSpecification spec = new RequestSpecBuilder()
.setBaseUri(String.format("%s://%s", url.getProtocol(), url.getHost()))
.setPort(8443)
.setKeyStore("client-keystore.jks", "password")
.setTrustStore("client-truststore.jks", "password")
.build();
given().spec(spec).get("/my-path").then().body(containsString("OK"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import java.net.URL;

import io.quarkus.test.junit.DisabledOnNativeImage;
import org.junit.jupiter.api.Test;

import io.quarkus.test.common.http.TestHTTPResource;
Expand All @@ -29,6 +30,7 @@ public void testRouteRegistration() {
get("/my-path").then().body(containsString("OK"));
}

@DisabledOnNativeImage
@Test
public void testRouteRegistrationMTLS() {
RequestSpecification spec = new RequestSpecBuilder()
Expand Down

0 comments on commit eca64b8

Please sign in to comment.