From 369c4d423da6ead22c09222778a5e571578c10f9 Mon Sep 17 00:00:00 2001 From: Lea Lobanov Date: Thu, 31 Oct 2024 03:37:48 +0900 Subject: [PATCH] WIP: continue with code duplication changes --- .../org/onflow/flow/sdk/impl/FlowAccessApiImplTest.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/src/test/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImplTest.kt b/sdk/src/test/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImplTest.kt index 2bb37d99..3435562e 100644 --- a/sdk/src/test/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImplTest.kt +++ b/sdk/src/test/kotlin/org/onflow/flow/sdk/impl/FlowAccessApiImplTest.kt @@ -11,6 +11,7 @@ import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.mockito.ArgumentMatchers.any import org.mockito.Mockito.* +import org.onflow.flow.sdk.impl.AsyncFlowAccessApiImplTest.Companion.testException import org.onflow.protobuf.access.Access import org.onflow.protobuf.access.AccessAPIGrpc import org.onflow.protobuf.entities.* @@ -898,10 +899,9 @@ class FlowAccessApiImplTest { @Test fun `Test subscribeExecutionDataByBlockHeight error case`() = runTest { val blockHeight = 100L - val exception = RuntimeException("Test exception") `when`(mockExecutionDataApi.subscribeExecutionDataFromStartBlockHeight(any())) - .thenAnswer { throw exception } + .thenAnswer { throw testException } val (_, errorChannel) = flowAccessApiImpl.subscribeExecutionDataByBlockHeight(this, blockHeight) @@ -913,7 +913,7 @@ class FlowAccessApiImplTest { job.join() if (receivedException != null) { - assertEquals(exception.message, receivedException!!.message) + assertEquals(testException.message, receivedException!!.message) } else { fail("Expected error but got success") }