use of io.fabric8.kubernetes.api.model.EnvVar in project fabric8-maven-plugin by fabric8io.
the class EnvVarHandlerTest method envVarHandlerTest.
@Test
public void envVarHandlerTest() {
// Some Environment Variable in Config
EnvVar var1 = new EnvVarBuilder().withName("TEST1").withValue("OK").build();
EnvVar var2 = new EnvVarBuilder().withName("TEST2").withValue("DONE").build();
EnvVar var3 = new EnvVarBuilder().withName("TEST3").withValue("").build();
env.clear();
env.put(var1.getName(), var1.getValue());
env.put(var2.getName(), var2.getValue());
env.put(var3.getName(), var3.getValue());
EnvVarHandler envVarHandler = new EnvVarHandler(project);
new Expectations() {
{
externalEnvVarHandler.getExportedEnvironmentVariables(project, env);
ret.putAll(env);
result = ret;
}
};
List<EnvVar> envVars = envVarHandler.getEnvironmentVariables(env);
assertNotNull(envVars);
assertEquals(4, envVars.size());
assertTrue(envVars.contains(var1));
assertTrue(envVars.contains(var2));
assertTrue(envVars.contains(var3));
assertTrue(envVars.contains(var4));
}
use of io.fabric8.kubernetes.api.model.EnvVar in project strimzi by strimzi.
the class KafkaSetOperatorTest method testNeedsRollingUpdateEnvOffsetsRepFactor.
@Test
public void testNeedsRollingUpdateEnvOffsetsRepFactor() {
String envVar = KEY_KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR;
a.getSpec().getTemplate().getSpec().getContainers().get(0).getEnv().add(new EnvVar(envVar, containerEnvVars(a.getSpec().getTemplate().getSpec().getContainers().get(0)).get(envVar) + "-foo", null));
assertTrue(KafkaSetOperator.needsRollingUpdate(diff()));
}
use of io.fabric8.kubernetes.api.model.EnvVar in project strimzi by strimzi.
the class KafkaSetOperatorTest method testNeedsRollingUpdateEnvSomeOtherThing.
@Test
public void testNeedsRollingUpdateEnvSomeOtherThing() {
String envVar = "SOME_RANDOM_ENV";
a.getSpec().getTemplate().getSpec().getContainers().get(0).getEnv().add(new EnvVar(envVar, "foo", null));
assertTrue(KafkaSetOperator.needsRollingUpdate(diff()));
}
use of io.fabric8.kubernetes.api.model.EnvVar in project strimzi by strimzi.
the class KafkaSetOperatorTest method testNeedsRollingUpdateEnvTxnRepFactor.
@Test
public void testNeedsRollingUpdateEnvTxnRepFactor() {
String envVar = KEY_KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR;
a.getSpec().getTemplate().getSpec().getContainers().get(0).getEnv().add(new EnvVar(envVar, containerEnvVars(a.getSpec().getTemplate().getSpec().getContainers().get(0)).get(envVar) + "-foo", null));
assertTrue(KafkaSetOperator.needsRollingUpdate(diff()));
}
use of io.fabric8.kubernetes.api.model.EnvVar in project strimzi by strimzi.
the class ZookeeperSetOperatiorTest method testNeedsRollingUpdateEnvSomeOtherThing.
@Test
public void testNeedsRollingUpdateEnvSomeOtherThing() {
String envVar = "SOME_RANDOM_ENV";
a.getSpec().getTemplate().getSpec().getContainers().get(0).getEnv().add(new EnvVar(envVar, "foo", null));
assertTrue(ZookeeperSetOperator.needsRollingUpdate(diff()));
}
Aggregations