@Test public void should_materialize_file_content_from_annotation() throws Exception { new Expectations() { {{ context.resolvePath(file.toString()); result = file; }} }; final ConfigMap baseConfigMap = createAnnotationConfigMap("my-file", file); final KubernetesListBuilder builder = new KubernetesListBuilder() .addToConfigMapItems(baseConfigMap); new ConfigMapEnricher(context).create(PlatformMode.kubernetes, builder); final ConfigMap configMap = (ConfigMap) builder.buildFirstItem(); if (binary) { final Map<String, String> binaryData = configMap.getBinaryData(); assertThat(binaryData) .containsEntry("my-file", Base64.getEncoder().encodeToString(readFileContentAsBytes(file))); } else { final Map<String, String> data = configMap.getData(); assertThat(data) .containsEntry("my-file", readFileContentsAsString(file)); } final Map<String, String> annotations = configMap.getMetadata().getAnnotations(); assertThat(annotations) .isEmpty(); }
@Override public void create(PlatformMode platformMode, KubernetesListBuilder builder) { addAnnotations(builder); addConfigMapFromXmlConfigurations(builder); }
ConfigMapEnricher extends BaseEnricher { @Override public void create(PlatformMode platformMode, KubernetesListBuilder builder) { addAnnotations(builder); addConfigMapFromXmlConfigurations(builder); } }
ConfigMapEnricher extends BaseEnricher { @Override public void create(PlatformMode platformMode, KubernetesListBuilder builder) { addAnnotations(builder); addConfigMapFromXmlConfigurations(builder); } ConfigMapEnricher(MavenEnricherContext enricherContext); }
ConfigMapEnricher extends BaseEnricher { @Override public void create(PlatformMode platformMode, KubernetesListBuilder builder) { addAnnotations(builder); addConfigMapFromXmlConfigurations(builder); } ConfigMapEnricher(MavenEnricherContext enricherContext); @Override void create(PlatformMode platformMode, KubernetesListBuilder builder); }
ConfigMapEnricher extends BaseEnricher { @Override public void create(PlatformMode platformMode, KubernetesListBuilder builder) { addAnnotations(builder); addConfigMapFromXmlConfigurations(builder); } ConfigMapEnricher(MavenEnricherContext enricherContext); @Override void create(PlatformMode platformMode, KubernetesListBuilder builder);  }