use folk_core::runtime::{MockRuntime, Runtime};
use serde_json::json;
#[tokio::test]
async fn mock_runtime_echoes_request() {
let rt = MockRuntime::echo();
let mut worker = rt.spawn().await.unwrap();
worker.ready().await.unwrap();
let payload = json!({"hello": "world"});
let result = worker.execute("test", payload.clone()).await.unwrap();
assert_eq!(result, payload);
}
#[tokio::test]
async fn mock_worker_refuses_after_terminate() {
let rt = MockRuntime::echo();
let mut worker = rt.spawn().await.unwrap();
worker.ready().await.unwrap();
worker.terminate().await.unwrap();
let result = worker.execute("test", json!("hi")).await;
assert!(result.is_err());
}