File tree Expand file tree Collapse file tree 2 files changed +16
-8
lines changed
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/expectation Expand file tree Collapse file tree 2 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 2121import org .junit .jupiter .api .extension .RegisterExtension ;
2222
2323import io .fabric8 .kubernetes .api .model .ObjectMetaBuilder ;
24+ import io .javaoperatorsdk .annotation .Sample ;
2425import io .javaoperatorsdk .operator .junit .LocallyRunOperatorExtension ;
2526
2627import static io .javaoperatorsdk .operator .baseapi .expectation .onallevent .ExpectationReconciler .DEPLOYMENT_READY ;
2728import static org .assertj .core .api .Assertions .assertThat ;
2829import static org .awaitility .Awaitility .await ;
2930
31+ @ Sample (
32+ tldr = "Basic Expectation Pattern with AllEvents Trigger" ,
33+ description = """
34+ Demonstrates the basic expectation pattern using ExpectationManager with triggerReconcilerOnAllEvents = true.
35+ This pattern allows reconcilers to wait for specific conditions to be met (like a Deployment having 3 ready replicas)
36+ before proceeding with status updates. The test shows both successful expectation fulfillment and timeout handling.
37+ Requires @ControllerConfiguration(triggerReconcilerOnAllEvents = true) for proper operation.""" )
3038class ExpectationIT {
3139
3240 public static final String TEST_1 = "test1" ;
Original file line number Diff line number Diff line change 2121import org .junit .jupiter .api .extension .RegisterExtension ;
2222
2323import io .fabric8 .kubernetes .api .model .ObjectMetaBuilder ;
24+ import io .javaoperatorsdk .annotation .Sample ;
2425import io .javaoperatorsdk .operator .junit .LocallyRunOperatorExtension ;
2526
2627import static io .javaoperatorsdk .operator .baseapi .expectation .periodicclean .PeriodicCleanerExpectationReconciler .DEPLOYMENT_READY ;
2728import static org .assertj .core .api .Assertions .assertThat ;
2829import static org .awaitility .Awaitility .await ;
2930
30- /**
31- * Integration test showcasing PeriodicCleanerExpectationManager usage.
32- *
33- * <p>This test demonstrates the key benefits of PeriodicCleanerExpectationManager: 1. Works without
34- * requiring @ControllerConfiguration(triggerReconcilerOnAllEvents = true) 2. Automatically cleans
35- * up stale expectations periodically 3. Maintains the same expectation API and functionality as the
36- * regular ExpectationManager
37- */
31+ @ Sample (
32+ tldr = "Expectation Pattern with Periodic Cleanup" ,
33+ description = """
34+ Demonstrates the PeriodicCleanerExpectationManager pattern which provides automatic cleanup of stale expectations.
35+ This pattern works without requiring @ControllerConfiguration(triggerReconcilerOnAllEvents = true) and automatically
36+ cleans up stale expectations periodically (default: 1 minute). This is ideal for 'set and forget' scenarios where
37+ you want the same expectation API and functionality as the regular ExpectationManager but with automatic lifecycle management.""" )
3838class PeriodicCleanerExpectationIT {
3939
4040 public static final String TEST_1 = "test1" ;
You can’t perform that action at this time.
0 commit comments