Skip to content

Commit

Permalink
Flip arguments in assertEquals(), because the first is the expected v…
Browse files Browse the repository at this point in the history
…alue

Signed-off-by: Tianli Feng <[email protected]>
  • Loading branch information
Tianli Feng committed Mar 16, 2022
1 parent 8470749 commit 301edbc
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ public void testReindexSettingsExist() {
*/
public void testSettingFallback() {
assertEquals(
NoMasterBlockService.NO_CLUSTER_MANAGER_BLOCK_SETTING.get(Settings.EMPTY),
NoMasterBlockService.NO_MASTER_BLOCK_SETTING.get(Settings.EMPTY)
NoMasterBlockService.NO_MASTER_BLOCK_SETTING.get(Settings.EMPTY),
NoMasterBlockService.NO_CLUSTER_MANAGER_BLOCK_SETTING.get(Settings.EMPTY)

);
}

Expand All @@ -51,10 +52,10 @@ public void testSettingFallback() {
*/
public void testSettingGetValue() {
Settings settings = Settings.builder().put("cluster.no_cluster_manager_block", "all").build();
assertEquals(NoMasterBlockService.NO_CLUSTER_MANAGER_BLOCK_SETTING.get(settings), NoMasterBlockService.NO_MASTER_BLOCK_ALL);
assertEquals(NoMasterBlockService.NO_MASTER_BLOCK_ALL, NoMasterBlockService.NO_CLUSTER_MANAGER_BLOCK_SETTING.get(settings));
assertEquals(
NoMasterBlockService.NO_MASTER_BLOCK_SETTING.get(settings),
NoMasterBlockService.NO_MASTER_BLOCK_SETTING.getDefault(Settings.EMPTY)
NoMasterBlockService.NO_MASTER_BLOCK_SETTING.getDefault(Settings.EMPTY),
NoMasterBlockService.NO_MASTER_BLOCK_SETTING.get(settings)
);
}

Expand All @@ -64,8 +65,8 @@ public void testSettingGetValue() {
public void testSettingGetValueWithFallback() {
Settings settings = Settings.builder().put("cluster.no_master_block", "metadata_write").build();
assertEquals(
NoMasterBlockService.NO_CLUSTER_MANAGER_BLOCK_SETTING.get(settings),
NoMasterBlockService.NO_MASTER_BLOCK_METADATA_WRITES
NoMasterBlockService.NO_MASTER_BLOCK_METADATA_WRITES,
NoMasterBlockService.NO_CLUSTER_MANAGER_BLOCK_SETTING.get(settings)
);
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NoMasterBlockService.NO_MASTER_BLOCK_SETTING });
}
Expand All @@ -78,8 +79,8 @@ public void testSettingGetValueWhenBothAreConfigured() {
.put("cluster.no_cluster_manager_block", "all")
.put("cluster.no_master_block", "metadata_write")
.build();
assertEquals(NoMasterBlockService.NO_CLUSTER_MANAGER_BLOCK_SETTING.get(settings), NoMasterBlockService.NO_MASTER_BLOCK_ALL);
assertEquals(NoMasterBlockService.NO_MASTER_BLOCK_SETTING.get(settings), NoMasterBlockService.NO_MASTER_BLOCK_METADATA_WRITES);
assertEquals(NoMasterBlockService.NO_MASTER_BLOCK_ALL, NoMasterBlockService.NO_CLUSTER_MANAGER_BLOCK_SETTING.get(settings));
assertEquals(NoMasterBlockService.NO_MASTER_BLOCK_METADATA_WRITES, NoMasterBlockService.NO_MASTER_BLOCK_SETTING.get(settings));
assertSettingDeprecationsAndWarnings(new Setting<?>[] { NoMasterBlockService.NO_MASTER_BLOCK_SETTING });
}

Expand Down

0 comments on commit 301edbc

Please sign in to comment.