Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: continue with code duplication changes #140

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand Down Expand Up @@ -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)

Expand All @@ -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")
}
Expand Down
Loading