Skip to content

Commit

Permalink
add a test case of valid weight
Browse files Browse the repository at this point in the history
  • Loading branch information
bohhyang committed Nov 4, 2024
1 parent bdba636 commit c5801fb
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class TestZooKeeperAnnouncer
Collections.singletonMap(0, new PartitionData(5.345));
private static final Map<Integer, PartitionData> MAX_WEIGHT_AND_DECIMAL_PLACES_BREACH_PARTITION_DATA =
Collections.singletonMap(0, new PartitionData(10.89));
private static final Map<Integer, PartitionData> VALID_PARTITION_DATA =
Collections.singletonMap(0, new PartitionData(2.3));

@BeforeMethod
public void setUp()
Expand Down Expand Up @@ -71,6 +73,10 @@ public Object[][] getValidatePartitionDataDataProvider()
null, null, Collections.singletonMap(0, new PartitionData(-1.0)), null,
new IllegalArgumentException("Weight -1.0 in Partition 0 is negative. Please correct it."), 0, 0
},
{
// valid weight
"3.0", null, VALID_PARTITION_DATA, VALID_PARTITION_DATA, null, 0, 0
},
{
// no action default to IGNORE, which won't correct the value BUT will increment the counts
"10.0", null, MAX_WEIGHT_BREACH_PARTITION_DATA, MAX_WEIGHT_BREACH_PARTITION_DATA, null, 1, 0
Expand Down

0 comments on commit c5801fb

Please sign in to comment.