ekaterinadimitrova2 commented on code in PR #1759:
URL: https://github.com/apache/cassandra/pull/1759#discussion_r935583653


##########
test/unit/org/apache/cassandra/config/YamlConfigurationLoaderTest.java:
##########
@@ -311,6 +311,10 @@ public void converters()
         assertThatThrownBy(() -> 
from("stream_throughput_outbound_megabits_per_sec", 
-2).stream_throughput_outbound.toMegabitsPerSecondAsInt())
         .hasRootCauseInstanceOf(IllegalArgumentException.class)
         .hasRootCauseMessage("Invalid data rate: value must be non-negative");
+
+        // NEGATIVE_DATA_STORAGE_INT
+        assertThat(from("sstable_preemptive_open_interval_in_mb", 
"1").sstable_preemptive_open_interval.toMebibytes()).isEqualTo(1);
+        assertThat(from("sstable_preemptive_open_interval_in_mb", 
-2).sstable_preemptive_open_interval).isNull();
     }

Review Comment:
   The idea of this test is to check the two branches of the respective 
converter, in this case:
   `o -> o < 0 ? null : new DataStorageSpec.IntMebibytesBound(o)`
   
   0 or 1 for the test it doesn't matter. IntMebibytesBound accepts 
non-negative numbers and 0 is not a special case.
   
   Or is there anything special about 0 and that particular property?



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