File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
main/kotlin/io/emeraldpay/dshackle/upstream
test/kotlin/io/emeraldpay/dshackle/upstream Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class VerifyingReader(
1919 }
2020
2121 override fun read (key : DshackleRequest ): Mono <DshackleResponse > {
22- if (! methods.get().isCallable (key.method)) {
22+ if (! methods.get().isAvailable (key.method)) {
2323 return Mono .error(RpcException (RpcResponseError .CODE_METHOD_NOT_EXIST , " Unsupported method: ${key.method} " ))
2424 }
2525 return Mono .empty()
Original file line number Diff line number Diff line change @@ -18,19 +18,19 @@ class VerifyingReaderTest : ShouldSpec({
1818
1919 should("Return empty for allowed method") {
2020 val methods = mockk<CallMethods >()
21- every { methods.isCallable ("test_foo") } returns true
21+ every { methods.isAvailable ("test_foo") } returns true
2222 val reader = VerifyingReader (AtomicReference (methods))
2323
2424 val act = reader.read(DshackleRequest ("test_foo", emptyList()))
2525 .block(Duration .ofSeconds(1))
2626
2727 act shouldBe null
28- verify(exactly = 1) { methods.isCallable (any()) }
28+ verify(exactly = 1) { methods.isAvailable (any()) }
2929 }
3030
3131 should("Return error for allowed method") {
3232 val methods = mockk<CallMethods >()
33- every { methods.isCallable ("test_foo") } returns false
33+ every { methods.isAvailable ("test_foo") } returns false
3434 val reader = VerifyingReader (AtomicReference (methods))
3535
3636 val t = shouldThrow<RpcException > {
@@ -41,6 +41,6 @@ class VerifyingReaderTest : ShouldSpec({
4141 t shouldNotBe null
4242 t.message!! should contain("Unsupported method: test_foo")
4343
44- verify(exactly = 1) { methods.isCallable (any()) }
44+ verify(exactly = 1) { methods.isAvailable (any()) }
4545 }
4646})
You can’t perform that action at this time.
0 commit comments