Skip to content

Commit

Permalink
Add test coverage for 43373 using same ports for http and https
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarranzan committed Nov 21, 2024
1 parent 27b785d commit 7223973
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions http/vertx/src/test/java/io/quarkus/ts/vertx/PortConflictIT.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package io.quarkus.ts.vertx;

import static io.quarkus.test.services.Certificate.Format.PEM;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.junit.jupiter.api.Test;

import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.QuarkusScenario;
import io.quarkus.test.scenarios.annotations.DisabledOnQuarkusVersion;
import io.quarkus.test.services.Certificate;
import io.quarkus.test.services.QuarkusApplication;

@QuarkusScenario
@DisabledOnQuarkusVersion(version = "3\\.(8|9|10|11|12|13|14)\\..*|3\\.15\\.(0|1)(\\..*)?", reason = "Disabled on Quarkus versions before 3.15.2 due to known port conflict issue https://github.com/quarkusio/quarkus/issues/43373")
public class PortConflictIT {

static final int COMMON_PORT_HTTP_HTTPS = 50000;
@QuarkusApplication(ssl = true, certificates = @Certificate(format = PEM, configureHttpServer = true, configureKeystore = true, configureTruststore = true))
static RestService app = new RestService()
.setAutoStart(false)
.withProperty("quarkus.http.port", String.valueOf(COMMON_PORT_HTTP_HTTPS))
.withProperty("quarkus.http.ssl-port", String.valueOf(COMMON_PORT_HTTP_HTTPS));

@Test
void verifyAppBehaviourUsingSamePorts() {
assertThrows(AssertionError.class, () -> app.start(),
"Should fail because Both http and https servers started on port 50000");
String logs = app.getLogs().toString();
assertTrue(logs.contains("Both http and https servers started on port 50000"));
}

}

0 comments on commit 7223973

Please sign in to comment.