skoppu22 commented on code in PR #312:
URL: https://github.com/apache/cassandra-sidecar/pull/312#discussion_r2763404905


##########
server/src/test/java/org/apache/cassandra/sidecar/config/SidecarConfigurationTest.java:
##########
@@ -588,6 +588,41 @@ void testRepairConfiguration() throws IOException
         
assertThat(repairConfig.repairPollInterval()).isEqualTo(MillisecondBoundConfiguration.parse("500ms"));
     }
 
+    @Test
+    void testStoragePortConfiguration() throws IOException
+    {
+        // Test with explicit storage_port
+        String yamlWithStoragePort = "cassandra_instances:\n" +
+                                     "  - id: 1\n" +
+                                     "    host: localhost1\n" +
+                                     "    port: 9042\n" +
+                                     "    storage_port: 7001\n" +
+                                     "    storage_dir: /var/lib/cassandra\n" +
+                                     "    staging_dir: 
/var/lib/cassandra/staging\n" +
+                                     "    jmx_host: 127.0.0.1\n" +
+                                     "    jmx_port: 7199\n" +
+                                     "    jmx_ssl_enabled: false";
+        SidecarConfigurationImpl configWithStoragePort = 
SidecarConfigurationImpl.fromYamlString(yamlWithStoragePort);
+        
assertThat(configWithStoragePort.cassandraInstances()).isNotNull().hasSize(1);
+        InstanceConfiguration instance1 = 
configWithStoragePort.cassandraInstances().get(0);
+        assertThat(instance1.storagePort()).isEqualTo(7001);
+
+        // Test without storage_port (should return null)
+        String yamlWithoutStoragePort = "cassandra_instances:\n" +

Review Comment:
   Can we split this second part into a different test function, like 
testYamlWithoutStoragePort() etc, that will make clear to the reader that we 
are testing this scenario?



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

Reply via email to