Update constraint mock variable naming
@@ -20,11 +20,11 @@ public class MaintenanceWhenPendingGlobalMergesTest {
private static class Fixture {
MergePendingChecker mockPendingChecker = mock(MergePendingChecker.class);
- MaintenanceTransitionConstraint mockEligibilityChecker = mock(MaintenanceTransitionConstraint.class);
- MaintenanceWhenPendingGlobalMerges deriver = new MaintenanceWhenPendingGlobalMerges(mockPendingChecker, mockEligibilityChecker);
+ MaintenanceTransitionConstraint mockTransitionConstraint = mock(MaintenanceTransitionConstraint.class);
+ MaintenanceWhenPendingGlobalMerges deriver = new MaintenanceWhenPendingGlobalMerges(mockPendingChecker, mockTransitionConstraint);
Fixture() {
- when(mockEligibilityChecker.maintenanceTransitionAllowed(anyInt())).thenReturn(true);
+ when(mockTransitionConstraint.maintenanceTransitionAllowed(anyInt())).thenReturn(true);
}
}
@@ -111,7 +111,7 @@ public class MaintenanceWhenPendingGlobalMergesTest {
public void node_with_pending_merges_only_set_to_maintenance_if_eligible() {
Fixture f = new Fixture();
Arrays.asList(1, 2, 3).forEach(idx -> when(f.mockPendingChecker.mayHaveMergesPending(globalSpace(), idx)).thenReturn(true));
- Arrays.asList(1, 2, 4).forEach(idx -> when(f.mockEligibilityChecker.maintenanceTransitionAllowed(idx)).thenReturn(false));
+ Arrays.asList(1, 2, 4).forEach(idx -> when(f.mockTransitionConstraint.maintenanceTransitionAllowed(idx)).thenReturn(false));
AnnotatedClusterState derived = f.deriver.derivedFrom(stateFromString("distributor:5 storage:5"), defaultSpace());
assertThat(derived, equalTo(AnnotatedClusterStateBuilder.ofState("distributor:5 storage:5 .3.s:m")
.reason(MAY_HAVE_MERGES_PENDING, 3).build()));
