Skip to content

Commit fda19a2

Browse files
committed
changes from code review
Signed-off-by: Attila Mészáros <[email protected]>
1 parent 95f563f commit fda19a2

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/expectation/ExpectationManager.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,4 @@ public Optional<String> getExpectationName(P primary) {
140140
public void removeExpectation(P primary) {
141141
registeredExpectations.remove(ResourceID.fromResource(primary));
142142
}
143-
144-
public void cleanup(P primary) {
145-
registeredExpectations.remove(ResourceID.fromResource(primary));
146-
}
147143
}

operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/expectation/ExpectationManagerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ void getExpectationNameShouldReturnEmptyWhenNoExpectation() {
125125
}
126126

127127
@Test
128-
void cleanupShouldRemoveExpectation() {
128+
void removeExpectationShouldRemoveExpectation() {
129129
Expectation<ConfigMap> expectation = mock(Expectation.class);
130130

131131
expectationManager.setExpectation(configMap, Duration.ofMinutes(5), expectation);
132132
assertThat(expectationManager.isExpectationPresent(configMap)).isTrue();
133133

134-
expectationManager.cleanup(configMap);
134+
expectationManager.removeExpectation(configMap);
135135
assertThat(expectationManager.isExpectationPresent(configMap)).isFalse();
136136
}
137137

operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/expectation/ExpectationReconciler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public UpdateControl<ExpectationCustomResource> reconcile(
5757
// cleans up expectation manager for the resource on delete event
5858
// in case of cleaner interface used, this can done also there.
5959
if (context.isPrimaryResourceDeleted()) {
60-
expectationManager.cleanup(primary);
60+
expectationManager.removeExpectation(primary);
6161
}
6262

6363
// exiting asap if there is an expectation that is not timed out neither fulfilled

0 commit comments

Comments
 (0)