Skip to content

Commit

Permalink
Test fix. (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIMP authored Nov 29, 2023
1 parent 3e88902 commit a02f9b1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions zenoh-kotlin/src/commonTest/kotlin/io/zenoh/DeleteTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,14 @@ import kotlin.test.assertNotNull

class DeleteTest {

companion object {
val TEST_KEY_EXP = "example/testing/keyexpr".intoKeyExpr().getOrThrow()
}

@Test
fun subscriber_receivesDelete() {
fun delete_isProperlyReceivedBySubscriber() {
val session = Session.open().getOrThrow()
var receivedSample: Sample? = null
session.declareSubscriber(TEST_KEY_EXP).with { sample -> receivedSample = sample }.res()
session.delete(TEST_KEY_EXP).res()
val keyExpr = "example/testing/keyexpr".intoKeyExpr().getOrThrow()
session.declareSubscriber(keyExpr).with { sample -> receivedSample = sample }.res().getOrThrow()
session.delete(keyExpr).res()
session.close()

assertNotNull(receivedSample)
assertEquals(receivedSample!!.kind, SampleKind.DELETE)
}
Expand Down

0 comments on commit a02f9b1

Please sign in to comment.