Fixes an error in the contract testing tutorial.

This commit is contained in:
Joel Dudley 2017-11-27 12:02:02 +00:00 committed by GitHub
parent e13f64b1b3
commit 247c57766c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,15 +35,19 @@ We start with the empty ledger:
.. sourcecode:: java .. sourcecode:: java
import static net.corda.core.testing.JavaTestHelpers.*; import kotlin.Unit;
import static net.corda.core.contracts.JavaTestHelpers.*; import org.junit.Test;
import static net.corda.testing.NodeTestUtils.ledger;
public class CommercialPaperTest {
@Test @Test
public void emptyLedger() { public void emptyLedger() {
ledger(l -> { ledger(l -> {
return Unit.INSTANCE; // We need to return this explicitly return Unit.INSTANCE;
}); });
} }
}
The DSL keyword ``ledger`` takes a closure that can build up several transactions and may verify their overall The DSL keyword ``ledger`` takes a closure that can build up several transactions and may verify their overall
correctness. A ledger is effectively a fresh world with no pre-existing transactions or services within it. correctness. A ledger is effectively a fresh world with no pre-existing transactions or services within it.