From 05d116879c4a5521b8918b742a580bf5584da656 Mon Sep 17 00:00:00 2001 From: manosbatsis Date: Tue, 29 Aug 2023 23:27:40 +0300 Subject: [PATCH] chore: minor doc update --- README.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 43512d8..cb3cc8f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ -# corda5-testutils - -Test utilities for Corda 5 applications. +# corda5-testutils [![Maven Central](https://img.shields.io/maven-central/v/com.github.manosbatsis.corda5.testutils/integration-junit5.svg)](https://repo1.maven.org/maven2/com/github/manosbatsis/corda5/testutils/integration-junit5/) [![CI](https://github.com/manosbatsis/corda5-testutils/actions/workflows/gradle.yml/badge.svg)](https://github.com/manosbatsis/corda5-testutils/actions/workflows/gradle.yml) +Test utilities for Corda 5 applications. At the moment this project provides utilities for integration testing with the Corda 5 Combined Worker. ## Quick Howto @@ -23,6 +22,8 @@ In your gradle: 1. Run `./gradlew startCorda` and 2. Run `./gradlew 5-vNodeSetup` or `./gradlew 4-deployCPIs` as appropriate +See R3's [CSDE Overview](https://docs.r3.com/en/platform/corda/5.0/developing-applications/getting-started/overview.html#csde-corda) for more info. + ### Add a Test The `Corda5NodesExtension` will retrieve the list of virtual nodes from the combined worker @@ -44,17 +45,23 @@ import kotlin.test.assertTrue @ExtendWith(Corda5NodesExtension::class) open class DemoApplicationTests { - // Optional config for extension - val config = Corda5NodesConfig(debug = true) + // Optional config for extension, values bellow are defaults + val config = Corda5NodesConfig( + authUsername = "admin", + authPassword = "admin", + baseUrl = "https://localhost:8888/api/v1/", + httpMaxWaitSeconds = 60, + debug = false + ) - // Corda5 nodes extension provides the NodeHandles + // The Corda5NodesExtension provides the NodeHandles @Test fun recordingFlowTests(nodeHandles: NodeHandles) { // Get node handles val aliceNode = nodeHandles.getByCommonName("Alice") val bobNode = nodeHandles.getByCommonName("Bob") - // Create state + // Call flow val myFlowArgs = MyFlowArgs(aliceNode.memberX500Name, bobNode.memberX500Name) val createdStatus = aliceNode.waitForFlow( FlowRequest( @@ -62,8 +69,12 @@ open class DemoApplicationTests { requestBody = myFlowArgs ) ) - logger.info("Create flow status: $createdStatus") + // Check flow status assertTrue(createdStatus.isSuccess()) } } ``` + +## Feedback + +Issues, PRs etc. welcome. You can also try pinging me on https://cordaledger.slack.com \ No newline at end of file