Search in sources :

Example 6 with NamespaceConfig

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\"}"));
}
Also used : NamespaceConfig(io.aklivity.zilla.runtime.engine.config.NamespaceConfig) Test(org.junit.Test)

Example 7 with NamespaceConfig

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));
}
Also used : NamespaceConfig(io.aklivity.zilla.runtime.engine.config.NamespaceConfig) VaultConfig(io.aklivity.zilla.runtime.engine.config.VaultConfig) BindingConfig(io.aklivity.zilla.runtime.engine.config.BindingConfig) Test(org.junit.Test)

Example 8 with NamespaceConfig

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));
}
Also used : NamespaceConfig(io.aklivity.zilla.runtime.engine.config.NamespaceConfig) VaultConfig(io.aklivity.zilla.runtime.engine.config.VaultConfig) Test(org.junit.Test)

Example 9 with NamespaceConfig

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"));
}
Also used : NamespaceConfig(io.aklivity.zilla.runtime.engine.config.NamespaceConfig) Test(org.junit.Test)

Aggregations

NamespaceConfig (io.aklivity.zilla.runtime.engine.config.NamespaceConfig)9 Test (org.junit.Test)8 VaultConfig (io.aklivity.zilla.runtime.engine.config.VaultConfig)5 BindingConfig (io.aklivity.zilla.runtime.engine.config.BindingConfig)4 Engine (io.aklivity.zilla.runtime.engine.Engine)1 EngineConfiguration (io.aklivity.zilla.runtime.engine.EngineConfiguration)1 RouteConfig (io.aklivity.zilla.runtime.engine.config.RouteConfig)1 EngineExtContext (io.aklivity.zilla.runtime.engine.ext.EngineExtContext)1 EngineExtSpi (io.aklivity.zilla.runtime.engine.ext.EngineExtSpi)1 Tuning (io.aklivity.zilla.runtime.engine.internal.Tuning)1 NamespaceAdapter (io.aklivity.zilla.runtime.engine.internal.config.NamespaceAdapter)1 UniquePropertyKeysSchema (io.aklivity.zilla.runtime.engine.internal.registry.json.UniquePropertyKeysSchema)1 NamespacedId (io.aklivity.zilla.runtime.engine.internal.stream.NamespacedId)1 Mustache (io.aklivity.zilla.runtime.engine.internal.util.Mustache)1 JsonArray (jakarta.json.JsonArray)1 JsonException (jakarta.json.JsonException)1 JsonObject (jakarta.json.JsonObject)1 JsonPatch (jakarta.json.JsonPatch)1 JsonReader (jakarta.json.JsonReader)1 Jsonb (jakarta.json.bind.Jsonb)1