use of io.fabric8.maven.core.config.ResourceConfig in project fabric8-maven-plugin by fabric8io.
the class DaemonSetHandlerTest method daemonTemplateHandlerWithoutControllerTest.
@Test(expected = IllegalArgumentException.class)
public void daemonTemplateHandlerWithoutControllerTest() {
// without controller name
ContainerHandler containerHandler = new ContainerHandler(project, envVarHandler, probeHandler);
PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler);
DaemonSetHandler daemonSetHandler = new DaemonSetHandler(podTemplateHandler);
// without controller name
ResourceConfig config = new ResourceConfig.Builder().imagePullPolicy("IfNotPresent").withServiceAccount("test-account").volumes(volumes1).build();
daemonSetHandler.getDaemonSet(config, images);
}
use of io.fabric8.maven.core.config.ResourceConfig in project fabric8-maven-plugin by fabric8io.
the class DeploymentHandlerTest method deploymentTemplateHandlerTest.
@Test
public void deploymentTemplateHandlerTest() {
ContainerHandler containerHandler = new ContainerHandler(project, envVarHandler, probeHandler);
PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler);
DeploymentHandler deploymentHandler = new DeploymentHandler(podTemplateHandler);
ResourceConfig config = new ResourceConfig.Builder().imagePullPolicy("IfNotPresent").controllerName("testing").withServiceAccount("test-account").withReplicas(5).volumes(volumes1).build();
Deployment deployment = deploymentHandler.getDeployment(config, images);
// Assertion
assertNotNull(deployment.getSpec());
assertNotNull(deployment.getMetadata());
assertEquals(5, deployment.getSpec().getReplicas().intValue());
assertNotNull(deployment.getSpec().getTemplate());
assertEquals("testing", deployment.getMetadata().getName());
assertEquals("test-account", deployment.getSpec().getTemplate().getSpec().getServiceAccountName());
assertFalse(deployment.getSpec().getTemplate().getSpec().getVolumes().isEmpty());
assertEquals("test", deployment.getSpec().getTemplate().getSpec().getVolumes().get(0).getName());
assertEquals("/test/path", deployment.getSpec().getTemplate().getSpec().getVolumes().get(0).getHostPath().getPath());
assertNotNull(deployment.getSpec().getTemplate().getSpec().getContainers());
}
use of io.fabric8.maven.core.config.ResourceConfig in project fabric8-maven-plugin by fabric8io.
the class DeploymentHandlerTest method deploymentTemplateHandlerWithoutControllerTest.
@Test(expected = IllegalArgumentException.class)
public void deploymentTemplateHandlerWithoutControllerTest() {
// without controller name
ContainerHandler containerHandler = new ContainerHandler(project, envVarHandler, probeHandler);
PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler);
DeploymentHandler deploymentHandler = new DeploymentHandler(podTemplateHandler);
// without controller name
ResourceConfig config = new ResourceConfig.Builder().imagePullPolicy("IfNotPresent").withServiceAccount("test-account").withReplicas(5).volumes(volumes1).build();
deploymentHandler.getDeployment(config, images);
}
use of io.fabric8.maven.core.config.ResourceConfig in project fabric8-maven-plugin by fabric8io.
the class JobHandlerTest method daemonTemplateHandlerWithoutControllerTest.
@Test(expected = IllegalArgumentException.class)
public void daemonTemplateHandlerWithoutControllerTest() {
// without controller name
ContainerHandler containerHandler = new ContainerHandler(project, envVarHandler, probeHandler);
PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler);
JobHandler jobHandler = new JobHandler(podTemplateHandler);
// without controller name
ResourceConfig config = new ResourceConfig.Builder().imagePullPolicy("IfNotPresent").withServiceAccount("test-account").volumes(volumes1).build();
jobHandler.getJob(config, images);
}
use of io.fabric8.maven.core.config.ResourceConfig in project fabric8-maven-plugin by fabric8io.
the class JobHandlerTest method daemonTemplateHandlerWithInvalidNameTest.
@Test(expected = IllegalArgumentException.class)
public void daemonTemplateHandlerWithInvalidNameTest() {
// invalid controller name
ContainerHandler containerHandler = new ContainerHandler(project, envVarHandler, probeHandler);
PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler);
JobHandler jobHandler = new JobHandler(podTemplateHandler);
// with invalid controller name
ResourceConfig config = new ResourceConfig.Builder().imagePullPolicy("IfNotPresent").controllerName("TesTing").withServiceAccount("test-account").volumes(volumes1).build();
jobHandler.getJob(config, images);
}
Aggregations