1515import io .javaoperatorsdk .operator .sample .multiversioncrd .MultiVersionCRDTestReconciler1 ;
1616import io .javaoperatorsdk .operator .sample .multiversioncrd .MultiVersionCRDTestReconciler2 ;
1717
18- import static org . assertj . core . api . AssertionsForClassTypes .assertThat ;
18+ import static com . google . common . truth . Truth .assertThat ;
1919import static org .awaitility .Awaitility .await ;
2020
2121class MultiVersionCRDIT {
@@ -38,16 +38,16 @@ void multipleCRDVersions() {
3838 await ()
3939 .atMost (Duration .ofSeconds (2 ))
4040 .pollInterval (Duration .ofMillis (50 ))
41- .until (
41+ .untilAsserted (
4242 () -> {
4343 var crV1Now = operator .get (MultiVersionCRDTestCustomResource1 .class , CR_V1_NAME );
4444 var crV2Now = operator .get (MultiVersionCRDTestCustomResource2 .class , CR_V2_NAME );
45- return crV1Now .getStatus (). getReconciledBy (). size () == 1
46- && crV1Now .getStatus (). getReconciledBy ()
47- . contains ( MultiVersionCRDTestReconciler1 . class . getSimpleName ())
48- && crV2Now . getStatus (). getReconciledBy (). size () == 1
49- && crV2Now .getStatus ().getReconciledBy ()
50- . contains (MultiVersionCRDTestReconciler2 .class .getSimpleName ());
45+ assertThat ( crV1Now .getStatus ()). isNotNull ();
46+ assertThat ( crV2Now .getStatus ()). isNotNull ();
47+ assertThat ( crV1Now . getStatus (). getReconciledBy ())
48+ . containsExactly ( MultiVersionCRDTestReconciler1 . class . getSimpleName ());
49+ assertThat ( crV2Now .getStatus ().getReconciledBy () )
50+ . containsExactly (MultiVersionCRDTestReconciler2 .class .getSimpleName ());
5151 });
5252 }
5353
@@ -62,10 +62,11 @@ void invalidEventsDoesNotBreakEventHandling() {
6262 await ()
6363 .atMost (Duration .ofSeconds (2 ))
6464 .pollInterval (Duration .ofMillis (50 ))
65- .until (() -> {
65+ .untilAsserted (() -> {
6666 var crV1Now = operator .get (MultiVersionCRDTestCustomResource1 .class , CR_V1_NAME );
67- return crV1Now .getStatus ().getReconciledBy ()
68- .contains (MultiVersionCRDTestReconciler1 .class .getSimpleName ());
67+ assertThat (crV1Now .getStatus ()).isNotNull ();
68+ assertThat (crV1Now .getStatus ().getReconciledBy ())
69+ .containsExactly (MultiVersionCRDTestReconciler1 .class .getSimpleName ());
6970 });
7071 assertThat (
7172 operator
0 commit comments