@@ -374,51 +374,6 @@ void searchWithLabelsOneConfigMapFound() {
374374 }
375375
376376 /**
377- <<<<<<< HEAD
378- =======
379- * two configmaps are deployed: "color-configmap" with label: "{color:blue}" and
380- * "color-configmap-k8s" with label: "{color:red}". We search by "{color:blue}" and
381- * find one configmap. Since profiles are enabled, we will also be reading
382- * "color-configmap-k8s", even if its labels do not match provided ones.
383- */
384- @ Test
385- void searchWithLabelsOneConfigMapFoundAndOneFromProfileFound () {
386- ConfigMap colorConfigmap = new ConfigMapBuilder ().withNewMetadata ()
387- .withName ("color-configmap" )
388- .withLabels (Collections .singletonMap ("color" , "blue" ))
389- .endMetadata ()
390- .addToData ("one" , "1" )
391- .build ();
392-
393- ConfigMap colorConfigmapK8s = new ConfigMapBuilder ().withNewMetadata ()
394- .withName ("color-configmap-k8s" )
395- .withLabels (Collections .singletonMap ("color" , "red" ))
396- .endMetadata ()
397- .addToData ("two" , "2" )
398- .build ();
399-
400- mockClient .configMaps ().inNamespace (NAMESPACE ).resource (colorConfigmap ).create ();
401- mockClient .configMaps ().inNamespace (NAMESPACE ).resource (colorConfigmapK8s ).create ();
402- MockEnvironment environment = new MockEnvironment ();
403- environment .setActiveProfiles ("k8s" );
404-
405- NormalizedSource normalizedSource = new LabeledConfigMapNormalizedSource (NAMESPACE ,
406- Collections .singletonMap ("color" , "blue" ), true , ConfigUtils .Prefix .DELAYED , true );
407- Fabric8ConfigContext context = new Fabric8ConfigContext (mockClient , normalizedSource , NAMESPACE , environment );
408-
409- Fabric8ContextToSourceData data = new LabeledConfigMapContextToSourceDataProvider ().get ();
410- SourceData sourceData = data .apply (context );
411-
412- Assertions .assertThat (sourceData .sourceData ().size ()).isEqualTo (2 );
413- Assertions .assertThat (sourceData .sourceData ().get ("color-configmap.color-configmap-k8s.one" )).isEqualTo ("1" );
414- Assertions .assertThat (sourceData .sourceData ().get ("color-configmap.color-configmap-k8s.two" )).isEqualTo ("2" );
415- Assertions .assertThat (sourceData .sourceName ())
416- .isEqualTo ("configmap.color-configmap.color-configmap-k8s.default" );
417-
418- }
419-
420- /**
421- >>>>>>> main
422377 * <pre>
423378 * - configmap "color-configmap" with label "{color:blue}"
424379 * - configmap "shape-configmap" with labels "{color:blue, shape:round}"
@@ -479,26 +434,10 @@ void searchWithLabelsTwoConfigMapsFound() {
479434 Fabric8ContextToSourceData data = new LabeledConfigMapContextToSourceDataProvider ().get ();
480435 SourceData sourceData = data .apply (context );
481436
482- Assertions .assertThat (sourceData .sourceData ().size ()).isEqualTo (4 );
483- Assertions
484- .assertThat (sourceData .sourceData ()
485- .get ("color-configmap.color-configmap-k8s.shape-configmap.shape-configmap-k8s.one" ))
486- .isEqualTo ("1" );
487- Assertions
488- .assertThat (sourceData .sourceData ()
489- .get ("color-configmap.color-configmap-k8s.shape-configmap.shape-configmap-k8s.two" ))
490- .isEqualTo ("2" );
491- Assertions
492- .assertThat (sourceData .sourceData ()
493- .get ("color-configmap.color-configmap-k8s.shape-configmap.shape-configmap-k8s.four" ))
494- .isEqualTo ("4" );
495- Assertions
496- .assertThat (sourceData .sourceData ()
497- .get ("color-configmap.color-configmap-k8s.shape-configmap.shape-configmap-k8s.five" ))
498- .isEqualTo ("5" );
499-
500- Assertions .assertThat (sourceData .sourceName ())
501- .isEqualTo ("configmap.color-configmap.color-configmap-k8s.shape-configmap.shape-configmap-k8s.default" );
437+ Assertions .assertThat (sourceData .sourceData ().size ()).isEqualTo (2 );
438+ Assertions .assertThat (sourceData .sourceData ().get ("color-configmap.shape-configmap.one" )).isEqualTo ("1" );
439+ Assertions .assertThat (sourceData .sourceData ().get ("color-configmap.shape-configmap.two" )).isEqualTo ("2" );
440+ Assertions .assertThat (sourceData .sourceName ()).isEqualTo ("configmap.color-configmap.shape-configmap.default" );
502441
503442 }
504443
0 commit comments