From c0e7e6bca5eeb12fc4d185d8a7308c19cc3199ab Mon Sep 17 00:00:00 2001 From: Ahoo Wang Date: Thu, 9 Jan 2025 10:05:23 +0800 Subject: [PATCH] test(wow-core): update LocalFirstCommandBusTest to verify message content - Replace verifyTimeout with more specific message content verification - Check if the received message ID and isVoid flag match the expected values - Update test to cancel subscription after receiving the expected message --- .../kotlin/me/ahoo/wow/command/LocalFirstCommandBusTest.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wow-core/src/test/kotlin/me/ahoo/wow/command/LocalFirstCommandBusTest.kt b/wow-core/src/test/kotlin/me/ahoo/wow/command/LocalFirstCommandBusTest.kt index df78d5c61f5..da32e1171a5 100644 --- a/wow-core/src/test/kotlin/me/ahoo/wow/command/LocalFirstCommandBusTest.kt +++ b/wow-core/src/test/kotlin/me/ahoo/wow/command/LocalFirstCommandBusTest.kt @@ -60,7 +60,12 @@ class LocalFirstCommandBusTest : CommandBusSpec() { .subscribe() } .test() - .verifyTimeout(Duration.ofMillis(100)) + .consumeNextWith { + assertThat(it.message.id, equalTo(message.id)) + assertThat(it.message.isVoid, equalTo(true)) + } + .thenCancel() + .verify() } } }