Last active
March 11, 2022 08:39
-
-
Save gaol/7593cebcb2d1328d4ed50ece5ee1ac70 to your computer and use it in GitHub Desktop.
Should EventBusOptions.setClusterPublicPort(-1) fail ?
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
@Test | |
public void testEventBusOptions() { | |
VertxOptions vertxOptions1 = new VertxOptions(); | |
JsonObject json = vertxOptions1.toJson(); | |
VertxOptions vertxOptions2 = new VertxOptions(json); | |
assertEquals(json, vertxOptions2.toJson()); | |
} | |
// ======================== | |
The above test fails with the message: | |
testEventBusOptions(io.vertx.core.VertxOptionsTest) Time elapsed: 0.338 sec <<< ERROR! | |
java.lang.IllegalArgumentException: clusterPublicPort p must be in range 0 <= p <= 65535 | |
at io.vertx.core.eventbus.EventBusOptions.setClusterPublicPort(EventBusOptions.java:651) | |
at io.vertx.core.eventbus.EventBusOptionsConverter.fromJson(EventBusOptionsConverter.java:55) | |
at io.vertx.core.eventbus.EventBusOptions.<init>(EventBusOptions.java:165) | |
at io.vertx.core.VertxOptionsConverter.fromJson(VertxOptionsConverter.java:45) | |
at io.vertx.core.VertxOptions.<init>(VertxOptions.java:181) | |
at io.vertx.core.VertxOptionsTest.testEventBusOptions(VertxOptionsTest.java:321) | |
`-1` is the default value for clusterPublicPort, why we cannot set the value to the default one ? | |
There is also a test that `setClusterPublicPort(-1)` should fail at: https://github.com/eclipse-vertx/vert.x/blob/4.2.5/src/test/java/io/vertx/core/VertxOptionsTest.java#L84-L89 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment