@@ -84,7 +84,7 @@ void setup() {
8484 when (informerEventSourceConfiguration .getInformerConfig ()).thenReturn (informerConfig );
8585 when (informerConfig .getEffectiveNamespaces (any ())).thenReturn (DEFAULT_NAMESPACES_SET );
8686 when (informerEventSourceConfiguration .getSecondaryToPrimaryMapper ())
87- .thenReturn (mockSecondaryToPrimaryMapper );
87+ .thenReturn (mock ( SecondaryToPrimaryMapper . class ) );
8888 when (informerEventSourceConfiguration .getResourceClass ()).thenReturn (Deployment .class );
8989
9090 informerEventSource =
@@ -93,11 +93,6 @@ void setup() {
9393 // mocking start
9494 @ Override
9595 public synchronized void start () {}
96-
97- @ Override
98- public Optional <Deployment > get (ResourceID resourceID ) {
99- return temporaryResourceCache .getResourceFromCache (resourceID );
100- }
10196 });
10297
10398 var mockControllerConfig = mock (ControllerConfiguration .class );
@@ -346,30 +341,6 @@ void multipleCachingFilteringUpdates_variant4() {
346341 assertNoEventProduced ();
347342 }
348343
349- @ Test
350- void cachingFilteringUpdateEventUpdatesPrimaryToSecondaryIndex () {
351- withRealTemporaryResourceCache ();
352- var td = testDeployment ();
353- when (mockSecondaryToPrimaryMapper .toPrimaryResourceIDs (any ()))
354- .thenReturn (Set .of (ResourceID .fromResource (td )));
355-
356- informerEventSource .eventFilteringUpdateAndCacheResource (
357- td ,
358- d -> {
359- var d1 = testDeployment ();
360- d1 .getMetadata ().setResourceVersion ("2" );
361- return d1 ;
362- });
363-
364- var cr = new TestCustomResource ();
365- cr .setMetadata (
366- new ObjectMetaBuilder ()
367- .withName (td .getMetadata ().getName ())
368- .withNamespace (td .getMetadata ().getNamespace ())
369- .build ());
370- assertThat (informerEventSource .getSecondaryResources (cr )).isNotEmpty ();
371- }
372-
373344 private void assertNoEventProduced () {
374345 await ()
375346 .pollDelay (Duration .ofMillis (50 ))
0 commit comments