**refactor(dynamic): add Kafka HTTP emulator with publish/poll/commit support, extend endpoint rewriting and stub event recording across Java, Python, and Rust**

This commit is contained in:
elipeter 2026-05-27 11:01:46 -05:00
parent 433036aead
commit 57d3677bd4
7 changed files with 564 additions and 40 deletions

View file

@ -176,6 +176,8 @@ fn message_handler_python_dispatch_subscribes_to_loopback() {
entry_file("kafka_python"),
);
let h = lang::emit(&spec).expect("emit ok");
assert!(h.source.contains("_nyx_try_kafka_http"));
assert!(h.source.contains("NYX_KAFKA_ENDPOINT"));
assert!(h.source.contains("NyxKafkaLoopback"));
assert!(h.source.contains("subscribe"));
assert!(h.source.contains("poll"));
@ -192,6 +194,11 @@ fn message_handler_python_dispatch_subscribes_to_loopback() {
fn message_handler_java_emits_reflective_dispatch() {
let spec = make_spec(Lang::Java, "orders", "onMessage", entry_file("kafka_java"));
let h = lang::emit(&spec).expect("emit ok");
assert!(h.source.contains("nyxTryRealKafkaClient"));
assert!(h.source.contains("MockConsumer"));
assert!(h.source.contains("commitSync"));
assert!(h.source.contains("nyxTryKafkaHttp"));
assert!(h.source.contains("NYX_KAFKA_ENDPOINT"));
assert!(h.source.contains("NyxKafkaLoopback"));
assert!(h.source.contains("Class.forName"));
assert!(h.source.contains("getDeclaredMethod"));

View file

@ -945,6 +945,7 @@ fn migration_ruby_harness_carries_sentinel_and_handler() {
assert!(h.source.contains("AddIndex"));
assert!(h.source.contains("__nyx_stub_sql_record"));
assert!(h.source.contains("ActiveRecord::Base.establish_connection"));
assert!(h.source.contains("cls.migrate(:up)"));
assert!(h.source.contains("SQLite3::Database"));
assert!(h.source.contains("NYX_SQL_ENDPOINT"));
}