File tree Expand file tree Collapse file tree 3 files changed +56
-0
lines changed
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/expectation Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ package io .javaoperatorsdk .operator .baseapi .expectation ;
2
+
3
+ import io .fabric8 .kubernetes .api .model .Namespaced ;
4
+ import io .fabric8 .kubernetes .client .CustomResource ;
5
+ import io .fabric8 .kubernetes .model .annotation .Group ;
6
+ import io .fabric8 .kubernetes .model .annotation .ShortNames ;
7
+ import io .fabric8 .kubernetes .model .annotation .Version ;
8
+
9
+ @ Group ("sample.javaoperatorsdk" )
10
+ @ Version ("v1" )
11
+ @ ShortNames ("ecr" )
12
+ public class ExpectationCustomResource extends CustomResource <Void , Void > implements Namespaced {}
Original file line number Diff line number Diff line change
1
+ package io .javaoperatorsdk .operator .baseapi .expectation ;
2
+
3
+ import org .junit .jupiter .api .Test ;
4
+ import org .junit .jupiter .api .extension .RegisterExtension ;
5
+
6
+ import io .javaoperatorsdk .operator .junit .LocallyRunOperatorExtension ;
7
+
8
+ class ExpectationIT {
9
+
10
+ @ RegisterExtension
11
+ LocallyRunOperatorExtension extension =
12
+ LocallyRunOperatorExtension .builder ().withReconciler (new ExpectationReconciler ()).build ();
13
+
14
+ @ Test
15
+ void testExpectation () {}
16
+ }
Original file line number Diff line number Diff line change
1
+ package io .javaoperatorsdk .operator .baseapi .expectation ;
2
+
3
+ import java .util .List ;
4
+
5
+ import io .javaoperatorsdk .operator .api .reconciler .Context ;
6
+ import io .javaoperatorsdk .operator .api .reconciler .EventSourceContext ;
7
+ import io .javaoperatorsdk .operator .api .reconciler .Reconciler ;
8
+ import io .javaoperatorsdk .operator .api .reconciler .UpdateControl ;
9
+ import io .javaoperatorsdk .operator .processing .event .source .EventSource ;
10
+ import io .javaoperatorsdk .operator .processing .expectation .ExpectationManager ;
11
+
12
+ public class ExpectationReconciler implements Reconciler <ExpectationCustomResource > {
13
+
14
+ ExpectationManager <ExpectationCustomResource > expectationManager = new ExpectationManager <>();
15
+
16
+ @ Override
17
+ public UpdateControl <ExpectationCustomResource > reconcile (
18
+ ExpectationCustomResource resource , Context <ExpectationCustomResource > context ) {
19
+
20
+ return UpdateControl .noUpdate ();
21
+ }
22
+
23
+ @ Override
24
+ public List <EventSource <?, ExpectationCustomResource >> prepareEventSources (
25
+ EventSourceContext <ExpectationCustomResource > context ) {
26
+ return List .of ();
27
+ }
28
+ }
You can’t perform that action at this time.
0 commit comments