@@ -291,14 +291,45 @@ public void onClusterStepRunWithServiceWithBadPort_replaceIt() {
291
291
verifyClusterServiceReplaced (this ::withBadPort );
292
292
}
293
293
294
- // TODO: oracle.kubernetes.weblogic.domain.v2.Cluster.getConfiguration is broken. Doesn't fill in
295
- // Cluster#clusterService.
296
- // @Test
294
+ @ Test
297
295
public void onClusterStepRunWithServiceWithLabelAdded_replaceIt () {
298
296
configureClusterWithLabel ("anyLabel" , "anyValue" );
299
297
verifyClusterServiceReplaced (createClusterService (), withLabel (createClusterService ()));
300
298
}
301
299
300
+ @ Test
301
+ public void onClusterStepRunWithServiceWithLabelValueChanged_replaceIt () {
302
+ final String newLabelValue = "newValue" ;
303
+ configureClusterWithLabel ("anyLabel" , newLabelValue );
304
+ verifyClusterServiceReplaced (
305
+ withLabel (createClusterService ()), withLabel (createClusterService (), newLabelValue ));
306
+ }
307
+
308
+ @ Test
309
+ public void onClusterStepRunWithServiceWithLabelRemoved_replaceIt () {
310
+ verifyClusterServiceReplaced (this ::withLabel );
311
+ }
312
+
313
+ @ Test
314
+ public void onClusterStepRunWithServiceWithAnnotationAdded_replaceIt () {
315
+ configureClusterWithAnnotation ("anyAnnotation" , "anyValue" );
316
+ verifyClusterServiceReplaced (createClusterService (), withAnnotation (createClusterService ()));
317
+ }
318
+
319
+ @ Test
320
+ public void onClusterStepRunWithServiceWithAnnotationValueChanged_replaceIt () {
321
+ final String newAnnotationValue = "newValue" ;
322
+ configureClusterWithAnnotation ("anyAnnotation" , newAnnotationValue );
323
+ verifyClusterServiceReplaced (
324
+ withAnnotation (createClusterService ()),
325
+ withAnnotation (createClusterService (), newAnnotationValue ));
326
+ }
327
+
328
+ @ Test
329
+ public void onClusterStepRunWithServiceWithAnnotationRemoved_replaceIt () {
330
+ verifyClusterServiceReplaced (this ::withAnnotation );
331
+ }
332
+
302
333
@ Test
303
334
public void whenAttemptToReplaceBadClusterServiceFailsOnDelete_reportCompletionFailure () {
304
335
V1Service existingService = createClusterServiceWithBadPort ();
@@ -759,6 +790,10 @@ private void configureClusterWithLabel(String label, String value) {
759
790
configureDomain ().configureCluster (TEST_CLUSTER ).withServiceLabel (label , value );
760
791
}
761
792
793
+ private void configureClusterWithAnnotation (String annotation , String value ) {
794
+ configureDomain ().configureCluster (TEST_CLUSTER ).withServiceAnnotation (annotation , value );
795
+ }
796
+
762
797
private void configureManagedServerWithLabel (String label , String value ) {
763
798
configureDomain ().configureServer (TEST_SERVER_NAME ).withServiceLabel (label , value );
764
799
}
0 commit comments