Search code examples
spring-bootunit-testingkotlincontrollercorda

How to Unit test Service & controller (kotlin) in a Cordapp?


I have gone through many documentations for getting a sample of unit testing service and controller in a Cordapp, not the flows (that is already done using in corda docs). Can anyone please help me to get an example cordapp which implemented service unit testing?


Solution

  • We can use Mockito module for mocking and stabbing that is required for unit testing service functions and APIs.

    This link will direct more on how to mock CordaRPCops using mockito as an example.