elkhand commented on code in PR #23406:
URL: https://github.com/apache/flink/pull/23406#discussion_r1326304575
##########
flink-clients/src/test/java/org/apache/flink/client/cli/DefaultCLITest.java:
##########
@@ -46,6 +46,28 @@ void testCommandLineMaterialization() throws Exception {
assertThat(configuration.get(RestOptions.ADDRESS)).isEqualTo(hostname);
assertThat(configuration.get(RestOptions.PORT)).isEqualTo(port);
+
+ final String httpProtocol = "http";
+ final String hostnameWithHttpScheme = httpProtocol + "://" + hostname;
+ final String[] httpArgs = {"-m", hostnameWithHttpScheme + ':' + port};
+ final CommandLine httpCommandLine =
defaultCLI.parseCommandLineOptions(httpArgs, false);
+
+ Configuration newConfiguration =
defaultCLI.toConfiguration(httpCommandLine);
+
+
assertThat(newConfiguration.get(RestOptions.ADDRESS)).isEqualTo(hostname);
+ assertThat(newConfiguration.get(RestOptions.PORT)).isEqualTo(port);
+
assertThat(newConfiguration.get(RestOptions.PROTOCOL)).isEqualTo(httpProtocol);
+
+ final String httpsProtocol = "https";
+ final String hostnameWithHttpsScheme = httpsProtocol + "://" +
hostname;
+ final String[] httpsArgs = {"-m", hostnameWithHttpsScheme + ':' +
port};
+ final CommandLine httpsCommandLine =
defaultCLI.parseCommandLineOptions(httpsArgs, false);
+
+ Configuration httpsConfiguration =
defaultCLI.toConfiguration(httpsCommandLine);
+
+
assertThat(httpsConfiguration.get(RestOptions.ADDRESS)).isEqualTo(hostname);
+ assertThat(httpsConfiguration.get(RestOptions.PORT)).isEqualTo(port);
+
assertThat(httpsConfiguration.get(RestOptions.PROTOCOL)).isEqualTo(httpsProtocol);
Review Comment:
Added, thanks.
--
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]