@Test public void should_materialize_file_content_from_xml() throws Exception { final io.fabric8.maven.core.config.ConfigMap baseConfigMap = createXmlConfigMap(file); final ResourceConfig config = new ResourceConfig.Builder() .withConfigMap(baseConfigMap) .build(); new Expectations() {{ context.getConfiguration(); result = new Configuration.Builder().resource(config).build(); context.resolvePath(file.toString()); result = file; }}; final KubernetesListBuilder builder = new KubernetesListBuilder(); 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(file.getFileName().toString(), Base64.getEncoder().encodeToString(readFileContentAsBytes(file))); } else { final Map<String, String> data = configMap.getData(); assertThat(data) .containsEntry(file.getFileName().toString(), readFileContentsAsString(file)); } }
@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);  }