DefaultServiceEnricher extends BaseEnricher { @Override public void create(PlatformMode platformMode, KubernetesListBuilder builder) { ResourceConfig xmlConfig = getConfiguration().getResource().orElse(null); if (xmlConfig != null && xmlConfig.getServices() != null) { addServices(builder, xmlConfig.getServices()); } else { final Service defaultService = getDefaultService(); if (hasServices(builder)) { mergeInDefaultServiceParameters(builder, defaultService); } else { addDefaultService(builder, defaultService); } if(Configs.asBoolean(getConfig(Config.normalizePort))) { normalizeServicePorts(builder); } } } DefaultServiceEnricher(MavenEnricherContext buildContext); @Override void create(PlatformMode platformMode, KubernetesListBuilder builder);  }
@Test public void headlessServiceNegative() throws Exception { setupExpectations(false, "headless", "false"); DefaultServiceEnricher serviceEnricher = new DefaultServiceEnricher(context); KubernetesListBuilder builder = new KubernetesListBuilder(); serviceEnricher.create(PlatformMode.kubernetes, builder); KubernetesList list = builder.build(); assertEquals(list.getItems().size(),0); }