Test Driven Development for Blockchain Apps with R3 Corda — How to Write Contracts and Unit Tests
Please note that I am not affiliated with R3.
This tutorial will explain and provide examples for how to write unit tests for Contracts in Corda using Java and IntelliJ. Testing for decentralized applications is especially critical because without the centralized authority it will be more complicated to roll out fixes or oversee corrections in the event of unintended consequences from bugs or security loopholes. This being said, it will be critical to ensure that all of your Contract code clauses are tested and working as expected before deploying a distributed app to production.
Note: We will be using Java for this tutorial, but the same principles apply for Kotlin if that is your preference. A basic familiarity with Java should make it simple to translate this code to Kotlin.