use of io.aklivity.zilla.runtime.engine.config.NamespaceConfig in project zilla by aklivity.
the class NamespaceConfigAdapterTest method shouldWriteNamespace.
@Test
public void shouldWriteNamespace() {
NamespaceConfig config = new NamespaceConfig("test", emptyList(), emptyList(), emptyList());
String text = jsonb.toJson(config);
assertThat(text, not(nullValue()));
assertThat(text, equalTo("{\"name\":\"test\"}"));
}
use of io.aklivity.zilla.runtime.engine.config.NamespaceConfig in project zilla by aklivity.
the class NamespaceConfigAdapterTest method shouldReadNamespace.
@Test
public void shouldReadNamespace() {
String text = "{" + "\"name\": \"test\"," + "\"vaults\":" + "{" + "}," + "\"bindings\":" + "{" + "}," + "\"references\":" + "[" + "]" + "}";
NamespaceConfig config = jsonb.fromJson(text, NamespaceConfig.class);
assertThat(config, not(nullValue()));
assertThat(config.name, equalTo("test"));
assertThat(config.bindings, emptyCollectionOf(BindingConfig.class));
assertThat(config.vaults, emptyCollectionOf(VaultConfig.class));
assertThat(config.references, emptyCollectionOf(NamespaceRef.class));
}
use of io.aklivity.zilla.runtime.engine.config.NamespaceConfig in project zilla by aklivity.
the class NamespaceConfigAdapterTest method shouldReadNamespaceWithBinding.
@Test
public void shouldReadNamespaceWithBinding() {
String text = "{" + "\"name\": \"test\"," + "\"vaults\":" + "{" + "}," + "\"bindings\":" + "{" + "\"test\":" + "{" + "\"type\": \"test\"," + "\"kind\": \"server\"" + "}" + "}" + "}";
NamespaceConfig config = jsonb.fromJson(text, NamespaceConfig.class);
assertThat(config, not(nullValue()));
assertThat(config.name, equalTo("test"));
assertThat(config.bindings, hasSize(1));
assertThat(config.bindings.get(0).entry, equalTo("test"));
assertThat(config.bindings.get(0).type, equalTo("test"));
assertThat(config.bindings.get(0).kind, equalTo(SERVER));
assertThat(config.vaults, emptyCollectionOf(VaultConfig.class));
assertThat(config.references, emptyCollectionOf(NamespaceRef.class));
}
use of io.aklivity.zilla.runtime.engine.config.NamespaceConfig in project zilla by aklivity.
the class NamespaceConfigAdapterTest method shouldReadNamespaceWithVault.
@Test
public void shouldReadNamespaceWithVault() {
String text = "{" + "\"name\": \"test\"," + "\"bindings\":" + "{" + "}," + "\"vaults\":" + "{" + "\"default\":" + "{" + "\"type\": \"test\"" + "}" + "}" + "}";
NamespaceConfig config = jsonb.fromJson(text, NamespaceConfig.class);
assertThat(config, not(nullValue()));
assertThat(config.name, equalTo("test"));
assertThat(config.vaults, hasSize(1));
assertThat(config.vaults.get(0).name, equalTo("default"));
assertThat(config.vaults.get(0).type, equalTo("test"));
}
Aggregations