File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
operator-framework-core/src/test/java/io/javaoperatorsdk/operator Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 8
8
import io .fabric8 .kubernetes .api .model .apps .Deployment ;
9
9
import io .fabric8 .kubernetes .api .model .apps .DeploymentBuilder ;
10
10
import io .fabric8 .kubernetes .api .model .apps .DeploymentSpec ;
11
+ import io .fabric8 .kubernetes .api .model .apps .DeploymentStatus ;
11
12
import io .fabric8 .kubernetes .api .model .rbac .ClusterRole ;
12
13
import io .fabric8 .kubernetes .api .model .rbac .ClusterRoleBuilder ;
13
14
import io .fabric8 .kubernetes .client .CustomResource ;
@@ -116,6 +117,29 @@ void setsSpecCustomResourceWithReflection() {
116
117
assertThat (tomcat .getSpec ().getReplicas ()).isEqualTo (1 );
117
118
}
118
119
120
+ @ Test
121
+ void setsStatusWithReflection () {
122
+ Deployment deployment = new Deployment ();
123
+ DeploymentStatus status = new DeploymentStatus ();
124
+ status .setReplicas (2 );
125
+
126
+ ReconcilerUtils .setStatus (deployment , status );
127
+
128
+ assertThat (deployment .getStatus ().getReplicas ()).isEqualTo (2 );
129
+ }
130
+
131
+ @ Test
132
+ void getsStatusWithReflection () {
133
+ Deployment deployment = new Deployment ();
134
+ DeploymentStatus status = new DeploymentStatus ();
135
+ status .setReplicas (2 );
136
+ deployment .setStatus (status );
137
+
138
+ var res = ReconcilerUtils .getStatus (deployment );
139
+
140
+ assertThat (((DeploymentStatus ) res ).getReplicas ()).isEqualTo (2 );
141
+ }
142
+
119
143
@ Test
120
144
void loadYamlAsBuilder () {
121
145
DeploymentBuilder builder =
You can’t perform that action at this time.
0 commit comments