@@ -54,9 +54,9 @@ void setup() {
54
54
void cleanUpDiamondWorkflow () {
55
55
var workflow = new WorkflowBuilder <TestCustomResource >()
56
56
.addDependentResource (dd1 )
57
- .addDependentResource (dr1 ).dependsOn (dd1 )
58
- .addDependentResource (dd2 ).dependsOn (dd1 )
59
- .addDependentResource (dd3 ).dependsOn (dr1 , dd2 )
57
+ .addDependentResourceAndConfigure (dr1 ).toDependOn (dd1 )
58
+ .addDependentResourceAndConfigure (dd2 ).toDependOn (dd1 )
59
+ .addDependentResourceAndConfigure (dd3 ).toDependOn (dr1 , dd2 )
60
60
.build ();
61
61
62
62
var res = workflow .cleanup (new TestCustomResource (), mockContext );
@@ -73,9 +73,9 @@ void cleanUpDiamondWorkflow() {
73
73
void dontDeleteIfDependentErrored () {
74
74
var workflow = new WorkflowBuilder <TestCustomResource >()
75
75
.addDependentResource (dd1 )
76
- .addDependentResource (dd2 ).dependsOn (dd1 )
77
- .addDependentResource (dd3 ).dependsOn (dd2 )
78
- .addDependentResource (errorDD ).dependsOn (dd2 )
76
+ .addDependentResourceAndConfigure (dd2 ).toDependOn (dd1 )
77
+ .addDependentResourceAndConfigure (dd3 ).toDependOn (dd2 )
78
+ .addDependentResourceAndConfigure (errorDD ).toDependOn (dd2 )
79
79
.withThrowExceptionFurther (false )
80
80
.build ();
81
81
@@ -95,7 +95,8 @@ void dontDeleteIfDependentErrored() {
95
95
void cleanupConditionTrivialCase () {
96
96
var workflow = new WorkflowBuilder <TestCustomResource >()
97
97
.addDependentResource (dd1 )
98
- .addDependentResource (dd2 ).dependsOn (dd1 ).withDeletePostcondition (notMetCondition )
98
+ .addDependentResourceAndConfigure (dd2 ).toDependOn (dd1 )
99
+ .withDeletePostcondition (notMetCondition )
99
100
.build ();
100
101
101
102
var res = workflow .cleanup (new TestCustomResource (), mockContext );
@@ -110,7 +111,7 @@ void cleanupConditionTrivialCase() {
110
111
void cleanupConditionMet () {
111
112
var workflow = new WorkflowBuilder <TestCustomResource >()
112
113
.addDependentResource (dd1 )
113
- .addDependentResource (dd2 ).dependsOn (dd1 ).withDeletePostcondition (metCondition )
114
+ .addDependentResourceAndConfigure (dd2 ).toDependOn (dd1 ).withDeletePostcondition (metCondition )
114
115
.build ();
115
116
116
117
var res = workflow .cleanup (new TestCustomResource (), mockContext );
@@ -126,9 +127,10 @@ void cleanupConditionMet() {
126
127
void cleanupConditionDiamondWorkflow () {
127
128
var workflow = new WorkflowBuilder <TestCustomResource >()
128
129
.addDependentResource (dd1 )
129
- .addDependentResource (dd2 ).dependsOn (dd1 )
130
- .addDependentResource (dd3 ).dependsOn (dd1 ).withDeletePostcondition (notMetCondition )
131
- .addDependentResource (dd4 ).dependsOn (dd2 , dd3 )
130
+ .addDependentResourceAndConfigure (dd2 ).toDependOn (dd1 )
131
+ .addDependentResourceAndConfigure (dd3 ).toDependOn (dd1 )
132
+ .withDeletePostcondition (notMetCondition )
133
+ .addDependentResourceAndConfigure (dd4 ).toDependOn (dd2 , dd3 )
132
134
.build ();
133
135
134
136
var res = workflow .cleanup (new TestCustomResource (), mockContext );
@@ -162,10 +164,10 @@ void dontDeleteIfGarbageCollected() {
162
164
void ifDependentActiveDependentNormallyDeleted () {
163
165
var workflow = new WorkflowBuilder <TestCustomResource >()
164
166
.addDependentResource (dd1 )
165
- .addDependentResource (dd2 ).dependsOn (dd1 )
166
- .addDependentResource (dd3 ).dependsOn (dd1 )
167
+ .addDependentResourceAndConfigure (dd2 ).toDependOn (dd1 )
168
+ .addDependentResourceAndConfigure (dd3 ).toDependOn (dd1 )
167
169
.withActivationCondition (metCondition )
168
- .addDependentResource (dd4 ).dependsOn (dd2 , dd3 )
170
+ .addDependentResourceAndConfigure (dd4 ).toDependOn (dd2 , dd3 )
169
171
.build ();
170
172
171
173
var res = workflow .cleanup (new TestCustomResource (), mockContext );
@@ -182,11 +184,11 @@ void ifDependentActiveDependentNormallyDeleted() {
182
184
void ifDependentActiveDeletePostConditionIsChecked () {
183
185
var workflow = new WorkflowBuilder <TestCustomResource >()
184
186
.addDependentResource (dd1 )
185
- .addDependentResource (dd2 ).dependsOn (dd1 )
186
- .addDependentResource (dd3 ).dependsOn (dd1 )
187
+ .addDependentResourceAndConfigure (dd2 ).toDependOn (dd1 )
188
+ .addDependentResourceAndConfigure (dd3 ).toDependOn (dd1 )
187
189
.withDeletePostcondition (notMetCondition )
188
190
.withActivationCondition (metCondition )
189
- .addDependentResource (dd4 ).dependsOn (dd2 , dd3 )
191
+ .addDependentResourceAndConfigure (dd4 ).toDependOn (dd2 , dd3 )
190
192
.build ();
191
193
192
194
var res = workflow .cleanup (new TestCustomResource (), mockContext );
@@ -206,10 +208,10 @@ void ifDependentActiveDeletePostConditionIsChecked() {
206
208
void ifDependentInactiveDeleteIsNotCalled () {
207
209
var workflow = new WorkflowBuilder <TestCustomResource >()
208
210
.addDependentResource (dd1 )
209
- .addDependentResource (dd2 ).dependsOn (dd1 )
210
- .addDependentResource (dd3 ).dependsOn (dd1 )
211
+ .addDependentResourceAndConfigure (dd2 ).toDependOn (dd1 )
212
+ .addDependentResourceAndConfigure (dd3 ).toDependOn (dd1 )
211
213
.withActivationCondition (notMetCondition )
212
- .addDependentResource (dd4 ).dependsOn (dd2 , dd3 )
214
+ .addDependentResourceAndConfigure (dd4 ).toDependOn (dd2 , dd3 )
213
215
.build ();
214
216
215
217
var res = workflow .cleanup (new TestCustomResource (), mockContext );
@@ -225,11 +227,11 @@ void ifDependentInactiveDeleteIsNotCalled() {
225
227
void ifDependentInactiveDeletePostConditionNotChecked () {
226
228
var workflow = new WorkflowBuilder <TestCustomResource >()
227
229
.addDependentResource (dd1 )
228
- .addDependentResource (dd2 ).dependsOn (dd1 )
229
- .addDependentResource (dd3 ).dependsOn (dd1 )
230
+ .addDependentResourceAndConfigure (dd2 ).toDependOn (dd1 )
231
+ .addDependentResourceAndConfigure (dd3 ).toDependOn (dd1 )
230
232
.withDeletePostcondition (notMetCondition )
231
233
.withActivationCondition (notMetCondition )
232
- .addDependentResource (dd4 ).dependsOn (dd2 , dd3 )
234
+ .addDependentResourceAndConfigure (dd4 ).toDependOn (dd2 , dd3 )
233
235
.build ();
234
236
235
237
var res = workflow .cleanup (new TestCustomResource (), mockContext );
@@ -243,7 +245,7 @@ void ifDependentInactiveDeletePostConditionNotChecked() {
243
245
@ Test
244
246
void singleInactiveDependent () {
245
247
var workflow = new WorkflowBuilder <TestCustomResource >()
246
- .addDependentResource (dd1 )
248
+ .addDependentResourceAndConfigure (dd1 )
247
249
.withActivationCondition (notMetCondition )
248
250
.build ();
249
251
0 commit comments