Skip to content

Commit

Permalink
Flip arguments in assertEquals(), because the first is expected value
Browse files Browse the repository at this point in the history
Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed Mar 16, 2022
1 parent 03e29f8 commit 82ec6a0
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public void testReindexSettingsExist() {
*/
public void testSettingFallback() {
assertEquals(
ClusterBootstrapService.INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(Settings.EMPTY),
ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING.get(Settings.EMPTY)
ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING.get(Settings.EMPTY),
ClusterBootstrapService.INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(Settings.EMPTY)
);
}

Expand All @@ -53,10 +53,10 @@ public void testSettingFallback() {
*/
public void testSettingGetValue() {
Settings settings = Settings.builder().put("cluster.initial_cluster_manager_nodes", "node-a").build();
assertEquals(ClusterBootstrapService.INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(settings), Arrays.asList("node-a"));
assertEquals(Arrays.asList("node-a"), ClusterBootstrapService.INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(settings));
assertEquals(
ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING.get(settings),
ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING.getDefault(Settings.EMPTY)
ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING.getDefault(Settings.EMPTY),
ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING.get(settings)
);
}

Expand All @@ -65,7 +65,7 @@ public void testSettingGetValue() {
*/
public void testSettingGetValueWithFallback() {
Settings settings = Settings.builder().put("cluster.initial_master_nodes", "node-a").build();
assertEquals(ClusterBootstrapService.INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(settings), Arrays.asList("node-a"));
assertEquals(Arrays.asList("node-a"), ClusterBootstrapService.INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(settings));
assertSettingDeprecationsAndWarnings(new Setting<?>[] { ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING });
}

Expand All @@ -77,8 +77,8 @@ public void testSettingGetValueWhenBothAreConfigured() {
.put("cluster.initial_cluster_manager_nodes", "node-a")
.put("cluster.initial_master_nodes", "node-a, node-b")
.build();
assertEquals(ClusterBootstrapService.INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(settings), Arrays.asList("node-a"));
assertEquals(ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING.get(settings), Arrays.asList("node-a", "node-b"));
assertEquals(Arrays.asList("node-a"), ClusterBootstrapService.INITIAL_CLUSTER_MANAGER_NODES_SETTING.get(settings));
assertEquals(Arrays.asList("node-a", "node-b"), ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING.get(settings));
assertSettingDeprecationsAndWarnings(new Setting<?>[] { ClusterBootstrapService.INITIAL_MASTER_NODES_SETTING });
}
}

0 comments on commit 82ec6a0

Please sign in to comment.