From 301edbcf1e25ad3394951a923e51310d1b748518 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Tue, 15 Mar 2022 22:38:13 -0700 Subject: [PATCH] Flip arguments in assertEquals(), because the first is the expected value Signed-off-by: Tianli Feng --- ...MasterBlockServiceRenamedSettingTests.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/server/src/test/java/org/opensearch/cluster/coordination/NoMasterBlockServiceRenamedSettingTests.java b/server/src/test/java/org/opensearch/cluster/coordination/NoMasterBlockServiceRenamedSettingTests.java index 4c735fbdb55c2..2c988cad5f79c 100644 --- a/server/src/test/java/org/opensearch/cluster/coordination/NoMasterBlockServiceRenamedSettingTests.java +++ b/server/src/test/java/org/opensearch/cluster/coordination/NoMasterBlockServiceRenamedSettingTests.java @@ -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) + ); } @@ -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) ); } @@ -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 }); } @@ -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 }); }