@Test public void test() throws Exception { try { namespaceAdmin.get(NamespaceId.DEFAULT); Assert.fail("Default namespace should not exist."); } catch (NamespaceNotFoundException e) { // expected } // test that it creates the default namespace BootstrapStepResult result = defaultNamespaceCreator.execute("label", new JsonObject()); BootstrapStepResult expected = new BootstrapStepResult("label", BootstrapStepResult.Status.SUCCEEDED); Assert.assertEquals(expected, result); Assert.assertEquals(NamespaceMeta.DEFAULT, namespaceAdmin.get(NamespaceId.DEFAULT)); // test trying to create when it's already there won't error result = defaultNamespaceCreator.execute("label", new JsonObject()); expected = new BootstrapStepResult("label", BootstrapStepResult.Status.SUCCEEDED); Assert.assertEquals(expected, result); Assert.assertEquals(NamespaceMeta.DEFAULT, namespaceAdmin.get(NamespaceId.DEFAULT)); } }