Skip to content

Commit 5dbef65

Browse files
committed
improve expressiveness on constat
1 parent f8e2211 commit 5dbef65

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sample-operators/leader-election/src/test/java/io/javaoperatorsdk/operator/sample/LeaderElectionE2E.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class LeaderElectionE2E {
4141

4242
private static final String OPERATOR_1_POD_NAME = "leader-election-operator-1";
4343
private static final String OPERATOR_2_POD_NAME = "leader-election-operator-2";
44+
public static final int MINIMAL_EXPECTED_RECONCILIATION = 2;
4445

4546
private String namespace;
4647
private KubernetesClient client;
@@ -62,7 +63,8 @@ void otherInstancesTakesOverWhenSteppingDown() {
6263
.inNamespace(namespace).withName(TEST_RESOURCE_NAME).get().getStatus();
6364

6465
assertThat(actualStatus).isNotNull();
65-
assertThat(actualStatus.getReconciledBy()).hasSizeGreaterThan(2);
66+
assertThat(actualStatus.getReconciledBy())
67+
.hasSizeGreaterThan(MINIMAL_EXPECTED_RECONCILIATION);
6668
});
6769

6870
client.pods().inNamespace(namespace).withName(OPERATOR_1_POD_NAME).delete();
@@ -78,7 +80,8 @@ void otherInstancesTakesOverWhenSteppingDown() {
7880
.inNamespace(namespace).withName(TEST_RESOURCE_NAME).get().getStatus();
7981

8082
assertThat(actualStatus).isNotNull();
81-
assertThat(actualStatus.getReconciledBy()).hasSizeGreaterThan(actualListSize + 2);
83+
assertThat(actualStatus.getReconciledBy())
84+
.hasSizeGreaterThan(actualListSize + MINIMAL_EXPECTED_RECONCILIATION);
8285
});
8386

8487
assertReconciliations(

0 commit comments

Comments
 (0)