-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test coverage for 43373 using same ports for http and https
- Loading branch information
1 parent
27b785d
commit 7223973
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
http/vertx/src/test/java/io/quarkus/ts/vertx/PortConflictIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")); | ||
} | ||
|
||
} |