Repository: EnMasseProject/enmasse
Pull request #2933 (2019-06-25 08:56:59)

Fix  KubernetesDeserializer registration (Java)
The deserialiser registration used incorrect KIND names for some of our API extensions.  I haven't seen this cause a defect.


Patch:
diff --git a/.jenkins/Jenkinsfile-upgrade b/.jenkins/Jenkinsfile-upgrade
index 726a504d3..2591559ca 100644
--- a/.jenkins/Jenkinsfile-upgrade
+++ b/.jenkins/Jenkinsfile-upgrade
@@ -84,16 +84,18 @@ pipeline {
         stage('run systemtests upgrade tests') {
             steps {
                 withEnv([
-                    "TAG=latest",
-                    "USE_DUMMY_ADDRESS=true",
-                    "UPGRADE_TEMPLATES=${WORKSPACE}/templates/build/enmasse-latest"]) {
+                        "TAG=latest",
+                        "USE_DUMMY_ADDRESS=true",
+                        "UPGRADE_TEMPLATES=${WORKSPACE}/templates/build/enmasse-latest"]) {
                     withCredentials([string(credentialsId: 'openshift-host', variable: 'OPENSHIFT_URL'), usernamePassword(credentialsId: 'openshift-credentials', passwordVariable: 'OPENSHIFT_PASSWD', usernameVariable: 'OPENSHIFT_USER')]) {
                         script {
                             for (def startVersion : params.START_VERSION.split(",")) {
-                                println "Starting upgrade tests from version "+startVersion
-                                sh(script: 'make templates || true')
-                                def envVarsString = "START_TEMPLATES=${WORKSPACE}/templates/build/enmasse-${startVersion}"
-                                lib.runSystemtests('systemtests-upgrade', params.TEST_CASE, envVarsString)
+                                catchError {
+                                    println "Starting upgrade tests from version " + startVersion
+                                    sh(script: 'make templates || true')
+                                    def envVarsString = "START_TEMPLATES=${WORKSPACE}/templates/build/enmasse-${startVersion}"
+                                    lib.runSystemtests('systemtests-upgrade', params.TEST_CASE, envVarsString)
+                                }
                             }
                         }
                     }
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/broker-plugin/plugin/src/main/resources/brokered/broker.xml b/broker-plugin/plugin/src/main/resources/brokered/broker.xml
index a60595750..354f4ea8d 100644
--- a/broker-plugin/plugin/src/main/resources/brokered/broker.xml
+++ b/broker-plugin/plugin/src/main/resources/brokered/broker.xml
@@ -93,7 +93,7 @@ under the License.
       <address-settings>
          <!--default for catch all-->
          <address-setting match="#">
-            <dead-letter-address>DLQ</dead-letter-address>
+            <max-delivery-attempts>-1</max-delivery-attempts>
             <redelivery-delay>0</redelivery-delay>
             <!-- with -1 only the global-max-size is in use for limiting -->
             <max-size-bytes>-1</max-size-bytes>
diff --git a/broker-plugin/plugin/src/main/resources/standard/colocated/broker.xml b/broker-plugin/plugin/src/main/resources/standard/colocated/broker.xml
index dc54c820c..e9b4fef95 100644
--- a/broker-plugin/plugin/src/main/resources/standard/colocated/broker.xml
+++ b/broker-plugin/plugin/src/main/resources/standard/colocated/broker.xml
@@ -83,7 +83,7 @@ under the License.
       <address-settings>
          <!--default for catch all-->
          <address-setting match="#">
-            <dead-letter-address>DLQ</dead-letter-address>
+            <max-delivery-attempts>-1</max-delivery-attempts>
             <redelivery-delay>0</redelivery-delay>
             <!-- with -1 only the global-max-size is in use for limiting -->
             <max-size-bytes>-1</max-size-bytes>
diff --git a/broker-plugin/plugin/src/main/resources/standard/sharded-queue/broker.xml b/broker-plugin/plugin/src/main/resources/standard/sharded-queue/broker.xml
index 5e9c76f81..442b6fb86 100644
--- a/broker-plugin/plugin/src/main/resources/standard/sharded-queue/broker.xml
+++ b/broker-plugin/plugin/src/main/resources/standard/sharded-queue/broker.xml
@@ -85,7 +85,7 @@ under the License.
       <address-settings>
          <!--default for catch all-->
          <address-setting match="#">
-            <dead-letter-address>DLQ</dead-letter-address>
+            <max-delivery-attempts>-1</max-delivery-attempts>
             <redelivery-delay>0</redelivery-delay>
             <!-- with -1 only the global-max-size is in use for limiting -->
             <max-size-bytes>-1</max-size-bytes>
diff --git a/broker-plugin/plugin/src/main/resources/standard/sharded-topic/broker.xml b/broker-plugin/plugin/src/main/resources/standard/sharded-topic/broker.xml
index 018f816ad..28cbad42c 100644
--- a/broker-plugin/plugin/src/main/resources/standard/sharded-topic/broker.xml
+++ b/broker-plugin/plugin/src/main/resources/standard/sharded-topic/broker.xml
@@ -86,7 +86,7 @@ under the License.
       <address-settings>
          <!--default for catch all-->
          <address-setting match="#">
-            <dead-letter-address>DLQ</dead-letter-address>
+            <max-delivery-attempts>-1</max-delivery-attempts>
             <redelivery-delay>0</redelivery-delay>
             <!-- with -1 only the global-max-size is in use for limiting -->
             <max-size-bytes>-1</max-size-bytes>
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 -->


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" />