Skip to content

Commit 6402104

Browse files
committed
fix: smells
1 parent 84bc1c0 commit 6402104

File tree

2 files changed

+10
-25
lines changed
  • operator-framework-core/src

2 files changed

+10
-25
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/workflow/DependsOnRelation.java

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,23 @@ public class DependsOnRelation {
1010

1111
public DependsOnRelation() {}
1212

13-
public DependsOnRelation(DependentResourceNode owner, DependentResourceNode dependsOn) {
13+
public DependsOnRelation(DependentResourceNode<?, ?> owner,
14+
DependentResourceNode<?, ?> dependsOn) {
1415
this(owner, dependsOn, null);
1516
}
1617

17-
public DependsOnRelation(DependentResourceNode owner, DependentResourceNode dependsOn,
18+
public DependsOnRelation(DependentResourceNode<?, ?> owner, DependentResourceNode<?, ?> dependsOn,
1819
WaitCondition waitCondition) {
1920
this.owner = owner;
2021
this.dependsOn = dependsOn;
2122
this.waitCondition = waitCondition;
2223
}
2324

24-
25-
public void setOwner(DependentResourceNode owner) {
26-
this.owner = owner;
27-
}
28-
29-
public void setDependsOn(DependentResourceNode dependsOn) {
30-
this.dependsOn = dependsOn;
31-
}
32-
33-
public void setWaitCondition(WaitCondition waitCondition) {
34-
this.waitCondition = waitCondition;
35-
}
36-
3725
public DependentResourceNode<?, ?> getOwner() {
3826
return owner;
3927
}
4028

41-
public DependentResourceNode getDependsOn() {
29+
public DependentResourceNode<?, ?> getDependsOn() {
4230
return dependsOn;
4331
}
4432

operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/dependent/workflow/WorkflowTest.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ void exceptionHandlingSimpleCases() {
9191
var workflow = new WorkflowBuilder<TestCustomResource>()
9292
.addDependent(errorDR2).build()
9393
.build();
94-
assertThrows(AggregatedOperatorException.class, () -> {
95-
workflow.reconcile(new TestCustomResource(), null);
96-
});
94+
assertThrows(AggregatedOperatorException.class,
95+
() -> workflow.reconcile(new TestCustomResource(), null));
9796
assertThat(executionHistory).notReconciled(errorDR2);
9897
}
9998

@@ -104,9 +103,8 @@ void dependentsOnErroredResourceNotReconciled() {
104103
.addDependent(errorDR2).dependsOn(dr1).build()
105104
.addDependent(dr2).dependsOn(errorDR2).build()
106105
.build();
107-
assertThrows(AggregatedOperatorException.class, () -> {
108-
workflow.reconcile(new TestCustomResource(), null);
109-
});
106+
assertThrows(AggregatedOperatorException.class,
107+
() -> workflow.reconcile(new TestCustomResource(), null));
110108

111109
assertThat(executionHistory).reconciled(dr1).notReconciled(errorDR2, dr2);
112110
}
@@ -118,9 +116,8 @@ void onlyOneDependsOnErroredResourceNotReconciled() {
118116
.addDependent(errorDR2).build()
119117
.addDependent(dr2).dependsOn(errorDR2).dependsOn(dr1).build()
120118
.build();
121-
assertThrows(AggregatedOperatorException.class, () -> {
122-
workflow.reconcile(new TestCustomResource(), null);
123-
});
119+
assertThrows(AggregatedOperatorException.class,
120+
() -> workflow.reconcile(new TestCustomResource(), null));
124121

125122
assertThat(executionHistory).notReconciled(dr2);
126123
}

0 commit comments

Comments
 (0)