diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/binding/TestBindingFactory.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/binding/TestBindingFactory.java index 22c7112144..d6e8b7bb7b 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/binding/TestBindingFactory.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/binding/TestBindingFactory.java @@ -15,8 +15,11 @@ */ package io.aklivity.zilla.runtime.engine.test.internal.binding; +import static io.aklivity.zilla.runtime.engine.test.internal.binding.config.TestBindingOptionsConfigAdapter.DEFAULT_ASSERTION_SCHEMA; + import java.util.LinkedList; import java.util.List; +import java.util.Objects; import org.agrona.DirectBuffer; import org.agrona.MutableDirectBuffer; @@ -275,6 +278,14 @@ private void onInitialBegin( { doInitialReset(traceId); } + if (DEFAULT_ASSERTION_SCHEMA != assertion.schema) + { + String schema = handler.resolve(id); + if (!Objects.equals(assertion.schema, schema)) + { + doInitialReset(traceId); + } + } } else { diff --git a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/binding/config/TestBindingOptionsConfigAdapter.java b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/binding/config/TestBindingOptionsConfigAdapter.java index 6840c32814..4575e6bf68 100644 --- a/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/binding/config/TestBindingOptionsConfigAdapter.java +++ b/runtime/engine/src/test/java/io/aklivity/zilla/runtime/engine/test/internal/binding/config/TestBindingOptionsConfigAdapter.java @@ -33,6 +33,8 @@ public final class TestBindingOptionsConfigAdapter implements OptionsConfigAdapterSpi { + public static final String DEFAULT_ASSERTION_SCHEMA = new String(); + private static final String MODE_NAME = "mode"; private static final String CATALOG_NAME = "catalog"; private static final String AUTHORIZATION_NAME = "authorization"; @@ -174,7 +176,8 @@ public OptionsConfig adaptFromJson( JsonObject c = assertion.asJsonObject(); catalogAssertions.add(new TestBindingOptionsConfig.CatalogAssertion( c.containsKey(ID_NAME) ? c.getInt(ID_NAME) : 0, - c.containsKey(SCHEMA_NAME) ? !c.isNull(SCHEMA_NAME) ? c.getString(SCHEMA_NAME) : null : null, + c.containsKey(SCHEMA_NAME) ? !c.isNull(SCHEMA_NAME) ? c.getString(SCHEMA_NAME) + : null : DEFAULT_ASSERTION_SCHEMA, c.containsKey(DELAY_NAME) ? c.getJsonNumber(DELAY_NAME).longValue() : 0L)); } testOptions.catalogAssertions(catalogName, catalogAssertions);