Flaugh24 commented on code in PR #1632:
URL: https://github.com/apache/ignite-3/pull/1632#discussion_r1098370808


##########
modules/runner/src/test/java/org/apache/ignite/internal/component/RestAddressReporterTest.java:
##########
@@ -39,25 +39,53 @@ class RestAddressReporterTest {
     private static final String REST_ADDRESS_FILENAME = "rest-address";
 
     @Test
-    @DisplayName("REST server network address is reported to file")
-    void networkAddressReported(@TempDir Path tmpDir) throws IOException {
+    @DisplayName("REST server network addresses is reported to file")
+    void httpAndHttpsAddressesReported(@TempDir Path tmpDir) throws 
IOException {
         // Given
         RestAddressReporter reporter = new RestAddressReporter(tmpDir);
 
         // When
-        reporter.writeReport(new NetworkAddress("localhost", 9999));
+        reporter.writeReport(new NetworkAddress("localhost", 9999), new 
NetworkAddress("localhost", 8443));
+
+        // Then there is a report
+        String restAddress = 
Files.readString(tmpDir.resolve(REST_ADDRESS_FILENAME));
+        assertThat(restAddress, equalTo("http://localhost:9999, 
https://localhost:8443";));
+    }
+
+    @Test
+    @DisplayName("REST server HTTP address is reported to file")
+    void httpAddressReported(@TempDir Path tmpDir) throws IOException {
+        // Given
+        RestAddressReporter reporter = new RestAddressReporter(tmpDir);
+
+        // When
+        reporter.writeReport(new NetworkAddress("localhost", 9999), null);
 
         // Then there is a report
         String restAddress = 
Files.readString(tmpDir.resolve(REST_ADDRESS_FILENAME));
         assertThat(restAddress, equalTo("http://localhost:9999";));
     }
 
+    @Test
+    @DisplayName("REST server HTTPS address is reported to file")
+    void httpsAddressReported(@TempDir Path tmpDir) throws IOException {
+        // Given
+        RestAddressReporter reporter = new RestAddressReporter(tmpDir);
+
+        // When
+        reporter.writeReport(null, new NetworkAddress("localhost", 8443));

Review Comment:
   Now it looks like 
   1. in case of disabled SSL
   Node named defaultNode started successfully. REST addresses are 
[http://127.0.0.1:10300]
   2. in the case of enabled SSL
   Node named defaultNode started successfully. REST addresses are 
[https://127.0.0.1:10400]
   3. in case of dual protocol 
   Node named defaultNode started successfully. REST addresses are 
[http://127.0.0.1:10300, https://127.0.0.1:10400]
   



-- 
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]

Reply via email to