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

test: Use kotest and mockk to mock RPC request #641

Merged
merged 8 commits into from
Jul 20, 2023

Conversation

liuck8080
Copy link
Contributor

@liuck8080 liuck8080 commented May 8, 2023

What does this PR do?

  • Mock OkHttpClient to test light-client, so it does not need a light-client server running.

Why kotest and mockk

  • OkHttpClient referred in RpcService was written in kotlin.
  • kotlin can operate java code, so a kotlin test framework can server the purpose.
  • mockk support kotlin very well.
  • The famous test framework Spock can not mock class OkHttpClient, and mockk can do it very well.

Note

@liuck8080 liuck8080 requested a review from quake May 8, 2023 01:42
@liuck8080 liuck8080 marked this pull request as ready for review May 15, 2023 00:08
@quake quake merged commit 25dde25 into nervosnetwork:master Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants