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 <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed Mar 16, 2022
1 parent 8e29012 commit e9789b2
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ public void testSettingFallback() {
public void testSettingGetValue() {
Settings settings = Settings.builder().put("cluster.service.slow_cluster_manager_task_logging_threshold", "9s").build();
assertEquals(
MasterService.CLUSTER_MANAGER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings),
TimeValue.timeValueSeconds(9)
TimeValue.timeValueSeconds(9),
MasterService.CLUSTER_MANAGER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings)
);
assertEquals(
MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings),
MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.getDefault(Settings.EMPTY)
MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.getDefault(Settings.EMPTY),
MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings)

);
}

Expand All @@ -71,8 +72,9 @@ public void testSettingGetValue() {
public void testSettingGetValueWithFallback() {
Settings settings = Settings.builder().put("cluster.service.slow_master_task_logging_threshold", "8s").build();
assertEquals(
MasterService.CLUSTER_MANAGER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings),
TimeValue.timeValueSeconds(8)
TimeValue.timeValueSeconds(8),
MasterService.CLUSTER_MANAGER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings)

);
assertSettingDeprecationsAndWarnings(new Setting<?>[] { MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING });
}
Expand All @@ -86,10 +88,11 @@ public void testSettingGetValueWhenBothAreConfigured() {
.put("cluster.service.slow_master_task_logging_threshold", "8s")
.build();
assertEquals(
MasterService.CLUSTER_MANAGER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings),
TimeValue.timeValueSeconds(9)
TimeValue.timeValueSeconds(9),
MasterService.CLUSTER_MANAGER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings)

);
assertEquals(MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings), TimeValue.timeValueSeconds(8));
assertEquals(TimeValue.timeValueSeconds(8), MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING.get(settings));
assertSettingDeprecationsAndWarnings(new Setting<?>[] { MasterService.MASTER_SERVICE_SLOW_TASK_LOGGING_THRESHOLD_SETTING });
}

Expand Down

0 comments on commit e9789b2

Please sign in to comment.