Repository: EnMasseProject/enmasse
Pull request #2900 (2019-06-12 14:58:53)

Cleaned up use of IMAGE_PULL_POLICY
Signed-off-by: Vanessa <vbusch@redhat.com>

k-wall: @vbusch can you review please?

Patch:
diff --git a/address-space-controller/src/main/resources/templates/standard-space-infra.yaml b/address-space-controller/src/main/resources/templates/standard-space-infra.yaml
index cd25848ad..be2105a18 100644
--- a/address-space-controller/src/main/resources/templates/standard-space-infra.yaml
+++ b/address-space-controller/src/main/resources/templates/standard-space-infra.yaml
@@ -462,7 +462,7 @@ objects:
             value: ${BROKER_PLUGIN_IMAGE}
           - name: TOPIC_FORWARDER_IMAGE
             value: ${TOPIC_FORWARDER_IMAGE}
-          - name: ${IMAGE_PULL_POLICY}
+          - name: IMAGE_PULL_POLICY
             value: ${IMAGE_PULL_POLICY}
           image: ${STANDARD_CONTROLLER_IMAGE}
           imagePullPolicy: ${IMAGE_PULL_POLICY}
diff --git a/api-model/src/main/java/io/enmasse/address/model/CoreCrd.java b/api-model/src/main/java/io/enmasse/address/model/CoreCrd.java
index 7fb26cc97..78684d20b 100644
--- a/api-model/src/main/java/io/enmasse/address/model/CoreCrd.java
+++ b/api-model/src/main/java/io/enmasse/address/model/CoreCrd.java
@@ -26,19 +26,14 @@ public class CoreCrd {
 
     public static void registerCustomCrds() {
         KubernetesDeserializer.registerCustomKind(API_VERSION, Address.KIND, Address.class);
-        KubernetesDeserializer.registerCustomKind(API_VERSION, Address.KIND, AddressList.class);
         KubernetesDeserializer.registerCustomKind(API_VERSION, AddressList.KIND, AddressList.class);
 
-        KubernetesDeserializer.registerCustomKind(API_VERSION, Address.KIND, AddressSpace.class);
-        KubernetesDeserializer.registerCustomKind(API_VERSION, Address.KIND, AddressSpaceList.class);
         KubernetesDeserializer.registerCustomKind(API_VERSION, AddressSpace.KIND, AddressSpace.class);
         KubernetesDeserializer.registerCustomKind(API_VERSION, AddressSpaceList.KIND, AddressSpaceList.class);
 
-        KubernetesDeserializer.registerCustomKind(API_VERSION, Address.KIND, AddressSpaceSchema.class);
         KubernetesDeserializer.registerCustomKind(API_VERSION, AddressSpaceSchema.KIND, AddressSpaceSchema.class);
         KubernetesDeserializer.registerCustomKind(API_VERSION, AddressSpaceSchemaList.KIND, AddressSpaceSchemaList.class);
     }
-
     public static CustomResourceDefinition addresses() {
         return ADDRESS_CRD;
     }
diff --git a/api-model/src/main/java/io/enmasse/address/model/KubeUtil.java b/api-model/src/main/java/io/enmasse/address/model/KubeUtil.java
index cc7de06f2..18de372a3 100644
--- a/api-model/src/main/java/io/enmasse/address/model/KubeUtil.java
+++ b/api-model/src/main/java/io/enmasse/address/model/KubeUtil.java
@@ -143,31 +143,73 @@ public final class KubeUtil {
                 actualPodSpec.setTolerations(podSpec.getTolerations());
             }
 
+            for (Container desiredContainer : podSpec.getInitContainers()) {
+                for (Container actualContainer : actualPodSpec.getInitContainers()) {
+                    if (actualContainer.getName() != null && actualContainer.getName().equals(desiredContainer.getName())) {
+                        applyDesiredResources(desiredContainer, actualContainer);
+                        applyDesiredEnvironment(actualContainer, desiredContainer);
+                    }
+                }
+            }
+
             for (Container desiredContainer : podSpec.getContainers()) {
                 for (Container actualContainer : actualPodSpec.getContainers()) {
                     if (actualContainer.getName() != null && actualContainer.getName().equals(desiredContainer.getName())) {
-                        if (desiredContainer.getResources() != null) {
-                            actualContainer.setResources(desiredContainer.getResources());
-                        }
-
-                        List<EnvVar> desiredEnv = desiredContainer.getEnv();
-                        if (desiredEnv != null && !desiredEnv.isEmpty()) {
-                            if (actualContainer.getEnv() == null || actualContainer.getEnv().isEmpty()) {
-                                actualContainer.setEnv(desiredEnv);
-                            } else {
-                                Set<String> newNames = desiredEnv.stream().map(EnvVar::getName).collect(Collectors.toSet());
-                                List<EnvVar> current = new ArrayList<>(actualContainer.getEnv());
-                                current.removeIf(e -> e.getName() != null && newNames.contains(e.getName()));
-                                current.addAll(desiredEnv);
-                                actualContainer.setEnv(current);
-                            }
-                        }
+                        applyDesiredResources(desiredContainer, actualContainer);
+                        applyDesiredEnvironment(actualContainer, desiredContainer);
+                        applyDesiredProbeSettings(actualContainer.getLivenessProbe(), desiredContainer.getLivenessProbe());
+                        applyDesiredProbeSettings(actualContainer.getReadinessProbe(), desiredContainer.getReadinessProbe());
                     }
                 }
             }
         }
     }
 
+    private static void applyDesiredResources(Container desiredContainer, Container actualContainer) {
+        if (desiredContainer.getResources() != null) {
+            actualContainer.setResources(desiredContainer.getResources());
+        }
+    }
+
+    private static void applyDesiredProbeSettings(Probe actualProbe, Probe desiredProbe) {
+        if (actualProbe != null && desiredProbe != null) {
+            if (desiredProbe.getInitialDelaySeconds() != null) {
+                actualProbe.setInitialDelaySeconds(desiredProbe.getInitialDelaySeconds());
+            }
+
+            if (desiredProbe.getPeriodSeconds() != null) {
+                actualProbe.setPeriodSeconds(desiredProbe.getPeriodSeconds());
+            }
+
+            if (desiredProbe.getTimeoutSeconds() != null) {
+                actualProbe.setTimeoutSeconds(desiredProbe.getTimeoutSeconds());
+            }
+
+            if (desiredProbe.getSuccessThreshold() != null) {
+                actualProbe.setSuccessThreshold(desiredProbe.getSuccessThreshold());
+            }
+
+            if (desiredProbe.getFailureThreshold() != null) {
+                actualProbe.setFailureThreshold(desiredProbe.getFailureThreshold());
+            }
+        }
+    }
+
+    private static void applyDesiredEnvironment(Container actualContainer, Container desiredContainer) {
+        List<EnvVar> desiredEnv = desiredContainer.getEnv();
+        if (desiredEnv != null && !desiredEnv.isEmpty()) {
+            if (actualContainer.getEnv() == null || actualContainer.getEnv().isEmpty()) {
+                actualContainer.setEnv(desiredEnv);
+            } else {
+                Set<String> newNames = desiredEnv.stream().map(EnvVar::getName).collect(Collectors.toSet());
+                List<EnvVar> current = new ArrayList<>(actualContainer.getEnv());
+                current.removeIf(e -> e.getName() != null && newNames.contains(e.getName()));
+                current.addAll(desiredEnv);
+                actualContainer.setEnv(current);
+            }
+        }
+    }
+
 
     public static void validateName(String name) {
         if (name == null) {
diff --git a/api-model/src/main/java/io/enmasse/admin/model/v1/BrokeredInfraConfig.java b/api-model/src/main/java/io/enmasse/admin/model/v1/BrokeredInfraConfig.java
index 93ddfdacd..eda90cc85 100644
--- a/api-model/src/main/java/io/enmasse/admin/model/v1/BrokeredInfraConfig.java
+++ b/api-model/src/main/java/io/enmasse/admin/model/v1/BrokeredInfraConfig.java
@@ -29,7 +29,7 @@ public class BrokeredInfraConfig extends AbstractHasMetadataWithAdditionalProper
 
     public static final String KIND = "BrokeredInfraConfig";
 
-    private BrokeredInfraConfigSpec spec;
+    private BrokeredInfraConfigSpec spec = new BrokeredInfraConfigSpec();
 
     public BrokeredInfraConfig() {
         super(KIND, AdminCrd.API_VERSION_V1BETA1);
diff --git a/api-model/src/main/java/io/enmasse/admin/model/v1/StandardInfraConfig.java b/api-model/src/main/java/io/enmasse/admin/model/v1/StandardInfraConfig.java
index 292cb46d5..744f27a3b 100644
--- a/api-model/src/main/java/io/enmasse/admin/model/v1/StandardInfraConfig.java
+++ b/api-model/src/main/java/io/enmasse/admin/model/v1/StandardInfraConfig.java
@@ -31,7 +31,7 @@ public class StandardInfraConfig extends AbstractHasMetadataWithAdditionalProper
 
     public static final String KIND = "StandardInfraConfig";
 
-    private StandardInfraConfigSpec spec;
+    private StandardInfraConfigSpec spec = new StandardInfraConfigSpec();
 
     public StandardInfraConfig() {
         super(KIND, AdminCrd.API_VERSION_V1BETA1);
diff --git a/iot/iot-device-registry-infinispan/pom.xml b/iot/iot-device-registry-infinispan/pom.xml
index c1dfeedec..1047d62b1 100644
--- a/iot/iot-device-registry-infinispan/pom.xml
+++ b/iot/iot-device-registry-infinispan/pom.xml
@@ -75,16 +75,29 @@
 
     <!-- Test dependencies -->
     <dependency>
-      <groupId>io.vertx</groupId>
-      <artifactId>vertx-unit</artifactId>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-api</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.12</version>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-params</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.junit.platform</groupId>
+      <artifactId>junit-platform-launcher</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>io.vertx</groupId>
+      <artifactId>vertx-junit5</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.eclipse.hono</groupId>
       <artifactId>hono-service-base</artifactId>
@@ -114,23 +127,6 @@
         </configuration>
       </plugin>
 
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <dependencies>
-          <dependency>
-            <groupId>org.apache.maven.surefire</groupId>
-            <artifactId>surefire-junit4</artifactId>
-            <version>2.22.0</version>
-          </dependency>
-        </dependencies>
-        <configuration>
-          <includes>
-            <include>**/*Test.java</include>
-          </includes>
-        </configuration>
-      </plugin>
-
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-jar-plugin</artifactId>
diff --git a/iot/pom.xml b/iot/pom.xml
index e9f9a0a72..0014521ff 100644
--- a/iot/pom.xml
+++ b/iot/pom.xml
@@ -13,7 +13,7 @@
   <packaging>pom</packaging>
 
   <properties>
-    <hono.version>1.0-M3</hono.version>
+    <hono.version>1.0-M4</hono.version>
     <infinispan.version>9.4.13.Final</infinispan.version>
 
     <!-- align with Hono compatible versions -->
diff --git a/standard-controller/src/main/java/io/enmasse/controller/standard/TemplateBrokerSetGenerator.java b/standard-controller/src/main/java/io/enmasse/controller/standard/TemplateBrokerSetGenerator.java
index 172b09819..7b8f19094 100644
--- a/standard-controller/src/main/java/io/enmasse/controller/standard/TemplateBrokerSetGenerator.java
+++ b/standard-controller/src/main/java/io/enmasse/controller/standard/TemplateBrokerSetGenerator.java
@@ -99,6 +99,7 @@ public class TemplateBrokerSetGenerator implements BrokerSetGenerator {
         setIfEnvPresent(paramMap, TemplateParameter.BROKER_IMAGE);
         setIfEnvPresent(paramMap, TemplateParameter.BROKER_PLUGIN_IMAGE);
         setIfEnvPresent(paramMap, TemplateParameter.TOPIC_FORWARDER_IMAGE);
+        setIfEnvPresent(paramMap, TemplateParameter.IMAGE_PULL_POLICY);
 
         if (address != null) {
             paramMap.put(TemplateParameter.ADDRESS, address.getSpec().getAddress());
diff --git a/standard-controller/src/main/java/io/enmasse/controller/standard/TemplateParameter.java b/standard-controller/src/main/java/io/enmasse/controller/standard/TemplateParameter.java
index 8dfce2638..ddccb7175 100644
--- a/standard-controller/src/main/java/io/enmasse/controller/standard/TemplateParameter.java
+++ b/standard-controller/src/main/java/io/enmasse/controller/standard/TemplateParameter.java
@@ -29,6 +29,7 @@ public interface TemplateParameter {
     String BROKER_CONNECTOR_NETTY_THREADS = "BROKER_CONNECTOR_NETTY_THREADS";
     String BROKER_CONNECTOR_IDLE_TIMEOUT_MS = "BROKER_CONNECTOR_IDLE_TIMEOUT_MS";
 
+    String IMAGE_PULL_POLICY = "IMAGE_PULL_POLICY";
     String BROKER_IMAGE = "BROKER_IMAGE";
     String BROKER_PLUGIN_IMAGE = "BROKER_PLUGIN_IMAGE";
     String TOPIC_FORWARDER_IMAGE = "TOPIC_FORWARDER_IMAGE";


Test patch:
diff --git a/api-model/src/test/java/io/enmasse/address/model/v1/address/KubeUtilTest.java b/api-model/src/test/java/io/enmasse/address/model/v1/address/KubeUtilTest.java
index 4519c3e4e..97fba7f54 100644
--- a/api-model/src/test/java/io/enmasse/address/model/v1/address/KubeUtilTest.java
+++ b/api-model/src/test/java/io/enmasse/address/model/v1/address/KubeUtilTest.java
@@ -6,12 +6,16 @@ package io.enmasse.address.model.v1.address;
 
 import io.enmasse.address.model.KubeUtil;
 
+import static org.hamcrest.Matchers.*;
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.params.provider.Arguments.of;
 
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
 import java.util.stream.Stream;
 
-import org.hamcrest.Matchers;
+import io.fabric8.kubernetes.api.model.*;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
@@ -27,6 +31,11 @@ import static org.hamcrest.MatcherAssert.assertThat;
 
 public class KubeUtilTest {
 
+    private static final EnvVar FOO1_ENVVAR = new EnvVarBuilder().withName("FOO1").withValue("BAR").build();
+    private static final EnvVar FOO1_UPD_ENVVAR = new EnvVarBuilder().withName("FOO1").withValue("BAZ").build();
+    private static final EnvVar FOO2_ENVAR = new EnvVarBuilder().withName("FOO2").withValue("BAR").build();
+    private static final EnvVar FOO3_ENVVAR = new EnvVarBuilder().withName("FOO3").withValue("BAX").build();
+
     @Test
     public void testLeaveSpaceForPodIdentifier() {
         String address = "receiver-round-robincli_rhearatherlongaddresswhichcanbeverylongblablabla";
@@ -42,6 +51,169 @@ public class KubeUtilTest {
         assertNull(KubeUtil.sanitizeUserName(null));
     }
 
+    @Test
+    public void appliesContainerResourcesToPodTemplate() {
+        Container actualContainer = new ContainerBuilder()
+                .withName("foo").build();
+        Map<String, Quantity> widgets = Collections.singletonMap("widgets", new QuantityBuilder().withAmount("10").build());
+        ResourceRequirements resources = new ResourceRequirementsBuilder().withLimits(widgets).build();
+        Container desiredContainer = new ContainerBuilder()
+                .withName("foo")
+                .withResources(resources).build();
+
+        PodTemplateSpec actual = doApplyContainers(actualContainer, desiredContainer);
+
+        Container container = actual.getSpec().getContainers().get(0);
+        assertThat(container.getResources(), equalTo(resources));
+    }
+
+    @Test
+    public void appliesContainerOrderIgnored() {
+        Container actualFooContainer = new ContainerBuilder()
+                .withName("foo").build();
+        Container actualBarContainer = new ContainerBuilder()
+                .withName("bar").build();
+
+        Map<String, Quantity> widgets = Collections.singletonMap("widgets", new QuantityBuilder().withAmount("10").build());
+        ResourceRequirements resources = new ResourceRequirementsBuilder().withLimits(widgets).build();
+        Container desiredFooContainer = new ContainerBuilder()
+                .withName("foo")
+                .withResources(resources).build();
+
+        PodTemplateSpec actual1 = new PodTemplateSpecBuilder()
+                .withNewSpec()
+                .addToContainers(actualBarContainer, actualFooContainer)
+                .endSpec()
+                .build();
+
+        PodTemplateSpec desired = new PodTemplateSpecBuilder()
+                .withNewSpec()
+                .addToContainers(desiredFooContainer)
+                .endSpec()
+                .build();
+
+        KubeUtil.applyPodTemplate(actual1, desired);
+
+        PodTemplateSpec actual = actual1;
+
+        Container barContainer = actual.getSpec().getContainers().get(0);
+        assertThat(barContainer.getName(), equalTo("bar"));
+        assertThat(barContainer.getResources(), nullValue());
+
+        Container fooContainer = actual.getSpec().getContainers().get(1);
+        assertThat(fooContainer.getName(), equalTo("foo"));
+        assertThat(fooContainer.getResources(), equalTo(resources));
+    }
+
+    @Test
+    public void appliesContainerEnvVarToPodTemplate() {
+        Container actualContainer = new ContainerBuilder()
+                .withName("foo")
+                .withEnv(FOO1_ENVVAR, FOO2_ENVAR).build();
+        Container desiredContainer = new ContainerBuilder()
+                .withName("foo")
+                .withEnv(FOO1_UPD_ENVVAR, FOO3_ENVVAR).build();
+
+        PodTemplateSpec actual = doApplyContainers(actualContainer, desiredContainer);
+
+        Container container = actual.getSpec().getContainers().get(0);
+        List<EnvVar> probe = container.getEnv();
+        assertThat(probe.size(), equalTo(3));
+        assertThat(probe, containsInAnyOrder(FOO1_UPD_ENVVAR, FOO2_ENVAR, FOO3_ENVVAR));
+    }
+
+    @Test
+    public void appliesInitContainerEnvVarToPodTemplate() {
+        Container actualContainer = new ContainerBuilder()
+                .withName("foo")
+                .withEnv(FOO1_ENVVAR).build();
+        Container desiredContainer = new ContainerBuilder()
+                .withName("foo")
+                .withEnv(FOO1_UPD_ENVVAR).build();
+
+        PodTemplateSpec actual = doApplyInitContainers(actualContainer, desiredContainer);
+
+        Container container = actual.getSpec().getInitContainers().get(0);
+        List<EnvVar> probe = container.getEnv();
+        assertThat(probe.size(), equalTo(1));
+        assertThat(probe, containsInAnyOrder(FOO1_UPD_ENVVAR));
+    }
+
+    @Test
+    public void appliesContainerLivenessProbeSettingsToPodTemplate() {
+        Container actualContainer = new ContainerBuilder()
+                .withName("foo")
+                .withLivenessProbe(new ProbeBuilder()
+                        .withInitialDelaySeconds(1)
+                        .withNewPeriodSeconds(2)
+                        .withFailureThreshold(4).build()).build();
+        Container desiredContainer = new ContainerBuilder()
+                .withName("foo")
+                .withLivenessProbe(new ProbeBuilder()
+                        .withInitialDelaySeconds(10)
+                        .withSuccessThreshold(80).build()).build();
+        PodTemplateSpec actual = doApplyContainers(actualContainer, desiredContainer);
+
+        Container container = actual.getSpec().getContainers().get(0);
+        Probe probe = container.getLivenessProbe();
+        assertThat(probe.getInitialDelaySeconds(), equalTo(10));
+        assertThat(probe.getPeriodSeconds(), equalTo(2));
+        assertThat(probe.getFailureThreshold(), equalTo(4));
+        assertThat(probe.getSuccessThreshold(), equalTo(80));
+    }
+
+    @Test
+    public void appliesContainerReadinessProbeSettingsToPodTemplate() {
+        Container actualContainer = new ContainerBuilder()
+                .withName("foo")
+                .withReadinessProbe(new ProbeBuilder()
+                        .withInitialDelaySeconds(1).build()).build();
+        Container desiredContainer = new ContainerBuilder()
+                .withName("foo")
+                .withReadinessProbe(new ProbeBuilder()
+                        .withInitialDelaySeconds(10).build()).build();
+        PodTemplateSpec actual = doApplyContainers(actualContainer, desiredContainer);
+
+        Container container = actual.getSpec().getContainers().get(0);
+        assertThat(container.getReadinessProbe().getInitialDelaySeconds(), equalTo(10));
+    }
+
+    private PodTemplateSpec doApplyContainers(Container actualContainer, Container desiredContainer) {
+        PodTemplateSpec actual = new PodTemplateSpecBuilder()
+                .withNewSpec()
+                .addToContainers(actualContainer)
+                .endSpec()
+                .build();
+
+        PodTemplateSpec desired = new PodTemplateSpecBuilder()
+                .withNewSpec()
+                .addToContainers(desiredContainer)
+                .endSpec()
+                .build();
+
+        KubeUtil.applyPodTemplate(actual, desired);
+
+        return actual;
+    }
+
+    private PodTemplateSpec doApplyInitContainers(Container actualContainer, Container desiredContainer) {
+        PodTemplateSpec actual = new PodTemplateSpecBuilder()
+                .withNewSpec()
+                .addToInitContainers(actualContainer)
+                .endSpec()
+                .build();
+
+        PodTemplateSpec desired = new PodTemplateSpecBuilder()
+                .withNewSpec()
+                .addToInitContainers(desiredContainer)
+                .endSpec()
+                .build();
+
+        KubeUtil.applyPodTemplate(actual, desired);
+
+        return actual;
+    }
+
     protected static Stream<Arguments> commonNames() {
         return Stream.of(
                         of("foo", "foo"),
@@ -81,7 +253,7 @@ public class KubeUtilTest {
     public void testSanitizeAddressName(final String input, final String output) {
         final String result = KubeUtil.sanitizeName(input);
 
-        assertThat(result.length(), Matchers.lessThanOrEqualTo(60));
+        assertThat(result.length(), lessThanOrEqualTo(60));
         assertEquals(output, result);
 
     }
diff --git a/api-model/src/test/java/io/enmasse/admin/model/v1/BrokeredInfraConfigTest.java b/api-model/src/test/java/io/enmasse/admin/model/v1/BrokeredInfraConfigTest.java
new file mode 100644
index 000000000..a396b088e
--- /dev/null
+++ b/api-model/src/test/java/io/enmasse/admin/model/v1/BrokeredInfraConfigTest.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2019, EnMasse authors.
+ * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
+ */
+package io.enmasse.admin.model.v1;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.junit.jupiter.api.Test;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+
+public class BrokeredInfraConfigTest {
+
+    @Test
+    public void testParseEmptySpec() throws IOException {
+        final ObjectMapper mapper = new ObjectMapper();
+
+        final URL url = BrokeredInfraConfigTest.class.getResource("resources/brokered-infra-empty.json");
+        final BrokeredInfraConfig value = mapper.readValue(url, BrokeredInfraConfig.class);
+
+        assertThat(value, notNullValue());
+
+        assertThat(value.getMetadata(), notNullValue());
+        assertThat(value.getMetadata().getName(), is("brokered"));
+
+        assertThat(value.getSpec(), notNullValue());
+
+
+    }
+
+}
diff --git a/api-model/src/test/java/io/enmasse/admin/model/v1/StandardInfraConfigTest.java b/api-model/src/test/java/io/enmasse/admin/model/v1/StandardInfraConfigTest.java
new file mode 100644
index 000000000..84782d5d5
--- /dev/null
+++ b/api-model/src/test/java/io/enmasse/admin/model/v1/StandardInfraConfigTest.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2019, EnMasse authors.
+ * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
+ */
+package io.enmasse.admin.model.v1;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.junit.jupiter.api.Test;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+
+public class StandardInfraConfigTest {
+
+    @Test
+    public void testParseEmptySpec() throws IOException {
+        final ObjectMapper mapper = new ObjectMapper();
+
+        final URL url = StandardInfraConfigTest.class.getResource("resources/standard-infra-empty.json");
+        final StandardInfraConfig value = mapper.readValue(url, StandardInfraConfig.class);
+
+        assertThat(value, notNullValue());
+
+        assertThat(value.getMetadata(), notNullValue());
+        assertThat(value.getMetadata().getName(), is("standard"));
+
+        assertThat(value.getSpec(), notNullValue());
+
+
+    }
+
+}
diff --git a/api-model/src/test/resources/io/enmasse/admin/model/v1/resources/brokered-infra-empty.json b/api-model/src/test/resources/io/enmasse/admin/model/v1/resources/brokered-infra-empty.json
new file mode 100644
index 000000000..d0cf622f3
--- /dev/null
+++ b/api-model/src/test/resources/io/enmasse/admin/model/v1/resources/brokered-infra-empty.json
@@ -0,0 +1,7 @@
+{
+    "apiVersion": "admin.enmasse.io/v1beta2",
+    "kind": "BrokeredInfraConfig",
+    "metadata": {
+        "name": "brokered"
+    }
+}
diff --git a/api-model/src/test/resources/io/enmasse/admin/model/v1/resources/standard-infra-empty.json b/api-model/src/test/resources/io/enmasse/admin/model/v1/resources/standard-infra-empty.json
new file mode 100644
index 000000000..998c748b4
--- /dev/null
+++ b/api-model/src/test/resources/io/enmasse/admin/model/v1/resources/standard-infra-empty.json
@@ -0,0 +1,7 @@
+{
+    "apiVersion": "admin.enmasse.io/v1beta2",
+    "kind": "StandardInfraConfig",
+    "metadata": {
+        "name": "standard"
+    }
+}
diff --git a/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/CacheCredentialsServiceTest.java b/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/CacheCredentialsServiceTest.java
index 10b179285..d35ae6b53 100644
--- a/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/CacheCredentialsServiceTest.java
+++ b/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/CacheCredentialsServiceTest.java
@@ -4,43 +4,34 @@
  */
 package io.enmasse.iot.registry.infinispan;
 
-import io.vertx.ext.unit.junit.VertxUnitRunner;
 import org.eclipse.hono.auth.SpringBasedHonoPasswordEncoder;
 import org.eclipse.hono.service.credentials.AbstractCompleteCredentialsServiceTest;
 import org.eclipse.hono.service.credentials.CompleteCredentialsService;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.rules.Timeout;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+import io.vertx.junit5.VertxExtension;
 
 import java.io.IOException;
-import java.util.concurrent.TimeUnit;
 
 /**
  * Tests verifying behavior of {@link CacheCredentialService}.
  *
  */
-@Ignore
-@RunWith(VertxUnitRunner.class)
+@Disabled
+@ExtendWith(VertxExtension.class)
 public class CacheCredentialsServiceTest extends AbstractCompleteCredentialsServiceTest {
 
     private static CacheCredentialService service;
     private static EmbeddedHotRodServer server;
 
-    /**
-     * Global timeout for all test cases.
-     */
-    @Rule
-    public Timeout globalTimeout = new Timeout(30, TimeUnit.SECONDS);
-
-
     /**
      * Spin up the service using Infinispan EmbeddedCache.
      */
-    @Before
+    @BeforeEach
     public void setUp() throws IOException {
 
         server = new EmbeddedHotRodServer();
@@ -50,7 +41,7 @@ public class CacheCredentialsServiceTest extends AbstractCompleteCredentialsServ
     /**
      * Stop the Embedded Infinispan Server.
      */
-    @After
+    @AfterEach
     public void cleanUp() {
         server.stop();
     }
diff --git a/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/CacheRegistrationServiceTest.java b/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/CacheRegistrationServiceTest.java
index 96830d4bf..4554572fb 100644
--- a/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/CacheRegistrationServiceTest.java
+++ b/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/CacheRegistrationServiceTest.java
@@ -5,42 +5,33 @@
 
 package io.enmasse.iot.registry.infinispan;
 
-import io.vertx.ext.unit.junit.VertxUnitRunner;
 import org.eclipse.hono.service.registration.AbstractCompleteRegistrationServiceTest;
 import org.eclipse.hono.service.registration.CompleteRegistrationService;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.rules.Timeout;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+import io.vertx.junit5.VertxExtension;
 
 import java.io.IOException;
-import java.util.concurrent.TimeUnit;
 
 /**
  * Tests verifying behavior of {@link CacheRegistrationService}.
  *
  */
-@Ignore
-@RunWith(VertxUnitRunner.class)
+@Disabled
+@ExtendWith(VertxExtension.class)
 public class CacheRegistrationServiceTest extends AbstractCompleteRegistrationServiceTest {
 
     private static CacheRegistrationService service;
     private static EmbeddedHotRodServer server;
 
-
-    /**
-     * Global timeout for all test cases.
-     */
-    @Rule
-    public Timeout globalTimeout = new Timeout(5, TimeUnit.SECONDS);
-
     /**
      * Spin up the service using Infinispan EmbeddedCache.
      * @throws IOException if the Protobuf spec file cannot be found.
      */
-    @Before
+    @BeforeEach
     public void setUp() throws IOException {
 
         server = new EmbeddedHotRodServer();
@@ -52,7 +43,7 @@ public class CacheRegistrationServiceTest extends AbstractCompleteRegistrationSe
      *
      * @return
      */
-    @After
+    @AfterEach
     public void cleanUp() {
         server.stop();
     }
diff --git a/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/CacheTenantServiceTest.java b/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/CacheTenantServiceTest.java
index 115593582..560ebcd38 100644
--- a/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/CacheTenantServiceTest.java
+++ b/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/CacheTenantServiceTest.java
@@ -5,42 +5,33 @@
 
 package io.enmasse.iot.registry.infinispan;
 
-import io.vertx.ext.unit.junit.VertxUnitRunner;
+import io.vertx.junit5.VertxExtension;
+
 import org.eclipse.hono.service.tenant.AbstractCompleteTenantServiceTest;
 import org.eclipse.hono.service.tenant.CompleteTenantService;
 
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.rules.Timeout;
-import org.junit.runner.RunWith;
-
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.extension.ExtendWith;
 import java.io.IOException;
-import java.util.concurrent.TimeUnit;
 
 /**
  * Tests verifying behavior of {@link CacheTenantService}.
  *
  */
-@Ignore
-@RunWith(VertxUnitRunner.class)
+@Disabled
+@ExtendWith(VertxExtension.class)
 public class CacheTenantServiceTest extends AbstractCompleteTenantServiceTest {
 
     private static CacheTenantService service;
     private static EmbeddedHotRodServer server;
 
-    /**
-     * Global timeout for all test cases.
-     */
-    @Rule
-    public Timeout globalTimeout = new Timeout(5, TimeUnit.SECONDS);
-
     /**
      * Spin up the service using Infinispan EmbeddedCache.
      * @throws IOException if the Protobuf spec file cannot be found.
      */
-    @Before
+    @BeforeEach
     public void setUp() throws IOException {
         server = new EmbeddedHotRodServer();
         service = new CacheTenantService(server.getCache());
@@ -51,7 +42,7 @@ public class CacheTenantServiceTest extends AbstractCompleteTenantServiceTest {
      *
      * @return
      */
-    @After
+    @AfterEach
     public void cleanUp() {
         server.stop();
     }
diff --git a/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/EmbeddedHotRodServer.java b/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/EmbeddedHotRodServer.java
index 5620eabd5..44d01cceb 100644
--- a/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/EmbeddedHotRodServer.java
+++ b/iot/iot-device-registry-infinispan/src/test/java/io/enmasse/iot/registry/infinispan/EmbeddedHotRodServer.java
@@ -52,7 +52,7 @@ public class EmbeddedHotRodServer {
 
         final SerializationContext serialCtx = ProtoStreamMarshaller.getSerializationContext(manager);
 
-        // genereate the protobuff schema
+        // generate the protobuf schema
         String generatedSchema = new ProtoSchemaBuilder()
                     .addClass(RegistryTenantObject.class)
                     .addClass(RegistryCredentialObject.class)
diff --git a/iot/iot-device-registry-infinispan/src/test/resources/logback.xml b/iot/iot-device-registry-infinispan/src/test/resources/logback.xml
index ab749e1da..11f94de82 100644
--- a/iot/iot-device-registry-infinispan/src/test/resources/logback.xml
+++ b/iot/iot-device-registry-infinispan/src/test/resources/logback.xml
@@ -8,6 +8,7 @@
     </appender>
 
     <logger name="org.eclipse.hono" level="DEBUG"/>
+    <logger name="io.enmasse.iot.registry.infinispan" level="DEBUG"/>
 
     <root level="INFO">
         <appender-ref ref="STDOUT" />