Search in sources :

Example 26 with ProcessorConfig

use of io.fabric8.maven.core.config.ProcessorConfig in project fabric8-maven-plugin by fabric8io.

the class VertxHealthCheckEnricherTest method testDisabledUsingNegativePortUsingConfiguration.

@Test
public void testDisabledUsingNegativePortUsingConfiguration() {
    final ProcessorConfig config = new ProcessorConfig(null, null, Collections.singletonMap("vertx-health-check", new TreeMap(ImmutableMap.of(VertxHealthCheckEnricher.Config.port.name(), "-1", VertxHealthCheckEnricher.Config.path.name(), "/ping"))));
    new Expectations() {

        {
            context.getConfig();
            result = config;
        }
    };
    VertxHealthCheckEnricher enricher = new VertxHealthCheckEnricher(context);
    Probe probe = enricher.getLivenessProbe();
    assertNull(probe);
    probe = enricher.getReadinessProbe();
    assertNull(probe);
}
Also used : Expectations(mockit.Expectations) TreeMap(java.util.TreeMap) Probe(io.fabric8.kubernetes.api.model.Probe) ProcessorConfig(io.fabric8.maven.core.config.ProcessorConfig) Test(org.junit.Test)

Example 27 with ProcessorConfig

use of io.fabric8.maven.core.config.ProcessorConfig in project fabric8-maven-plugin by fabric8io.

the class EnricherConfigTest method simple.

@Test
public void simple() throws Exception {
    Map<String, TreeMap> configMap = new HashMap<>();
    TreeMap map = new TreeMap();
    map.put("type", "LoadBalancer");
    configMap.put("default.service", map);
    EnricherConfig config = new EnricherConfig(new Properties(), "default.service", new ProcessorConfig(null, null, configMap));
    assertEquals("LoadBalancer", config.get(Config.type));
}
Also used : ProcessorConfig(io.fabric8.maven.core.config.ProcessorConfig) Test(org.junit.Test)

Aggregations

ProcessorConfig (io.fabric8.maven.core.config.ProcessorConfig)27 Test (org.junit.Test)21 Expectations (mockit.Expectations)17 TreeMap (java.util.TreeMap)10 Probe (io.fabric8.kubernetes.api.model.Probe)7 GeneratorContext (io.fabric8.maven.generator.api.GeneratorContext)5 ImageConfiguration (io.fabric8.maven.docker.config.ImageConfiguration)4 ArrayList (java.util.ArrayList)3 MavenProject (org.apache.maven.project.MavenProject)3 BuildImageConfiguration (io.fabric8.maven.docker.config.BuildImageConfiguration)2 Logger (io.fabric8.maven.docker.util.Logger)2 JSONArray (org.json.JSONArray)2 JSONObject (org.json.JSONObject)2 KubernetesListBuilder (io.fabric8.kubernetes.api.model.KubernetesListBuilder)1 PodTemplate (io.fabric8.kubernetes.api.model.PodTemplate)1 ReplicaSet (io.fabric8.kubernetes.api.model.extensions.ReplicaSet)1 PlatformMode (io.fabric8.maven.core.config.PlatformMode)1 Profile (io.fabric8.maven.core.config.Profile)1 Generator (io.fabric8.maven.generator.api.Generator)1 Watcher (io.fabric8.maven.watcher.api.Watcher)1