yifan-c commented on code in PR #130:
URL: https://github.com/apache/cassandra-sidecar/pull/130#discussion_r1706120536
##########
src/test/java/org/apache/cassandra/sidecar/server/ServerTest.java:
##########
@@ -181,6 +194,25 @@ void updatingTrafficShapingOptions(VertxTestContext
context)
});
}
+ @Test
+ @DisplayName("Updating traffic shaping options with non-zero listen port
should succeed")
+ void updateTrafficShapingOptionsWithNonZeroListenPort()
+ {
+ configureServer("config/sidecar_single_instance_default_port.yaml");
+
+ try
+ {
+ server.start().toCompletionStage().toCompletableFuture().get(30,
TimeUnit.SECONDS);
+ TrafficShapingOptions update = new TrafficShapingOptions()
+ .setOutboundGlobalBandwidth(100 *
1024 * 1024);
+ server.updateTrafficShapingOptions(update);
+ }
+ catch (Exception exception)
+ {
+ Assertions.fail(exception);
+ }
Review Comment:
I guess the catch is not necessary. Is it added because IDE complains no
assertion is performed?
If so, how about this?
```java
assertThatNoException().isThrownBy(() -> {
server.start().toCompletionStage().toCompletableFuture().get(30,
TimeUnit.SECONDS);
TrafficShapingOptions update = new TrafficShapingOptions()
.setOutboundGlobalBandwidth(100 *
1024 * 1024);
server.updateTrafficShapingOptions(update);
});
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]