Skip to content

Commit 4fad301

Browse files
committed
wip
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
1 parent aed40f2 commit 4fad301

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/source/informer/InformerEventSourceTest.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ class InformerEventSourceTest {
7878
@BeforeEach
7979
void setup() {
8080
final var informerConfig = mock(InformerConfiguration.class);
81+
SecondaryToPrimaryMapper secondaryToPrimaryMapper = mock(SecondaryToPrimaryMapper.class);
82+
when(informerEventSourceConfiguration.getSecondaryToPrimaryMapper())
83+
.thenReturn(secondaryToPrimaryMapper);
84+
when(secondaryToPrimaryMapper.toPrimaryResourceIDs(any()))
85+
.thenReturn(Set.of(ResourceID.fromResource(testDeployment())));
8186
when(informerEventSourceConfiguration.getInformerConfig()).thenReturn(informerConfig);
8287
when(informerConfig.getEffectiveNamespaces(any())).thenReturn(DEFAULT_NAMESPACES_SET);
83-
when(informerEventSourceConfiguration.getSecondaryToPrimaryMapper())
84-
.thenReturn(mock(SecondaryToPrimaryMapper.class));
8588
when(informerEventSourceConfiguration.getResourceClass()).thenReturn(Deployment.class);
86-
8789
informerEventSource =
8890
spy(
8991
new InformerEventSource<>(informerEventSourceConfiguration, clientMock) {
@@ -97,11 +99,6 @@ public synchronized void start() {}
9799

98100
informerEventSource.setEventHandler(eventHandlerMock);
99101
informerEventSource.setControllerConfiguration(mockControllerConfig);
100-
SecondaryToPrimaryMapper secondaryToPrimaryMapper = mock(SecondaryToPrimaryMapper.class);
101-
when(informerEventSourceConfiguration.getSecondaryToPrimaryMapper())
102-
.thenReturn(secondaryToPrimaryMapper);
103-
when(secondaryToPrimaryMapper.toPrimaryResourceIDs(any()))
104-
.thenReturn(Set.of(ResourceID.fromResource(testDeployment())));
105102
informerEventSource.start();
106103
informerEventSource.setTemporalResourceCache(temporaryResourceCache);
107104
}

0 commit comments

Comments
 (0)