mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
Move the CommercialPaperTest examples to a location where it'll be run by gradle/ci. Make sure the tests pass, even the example tests that are intended to fail, so these files are kept up to date as the code changes.
This commit is contained in:
@ -2,6 +2,7 @@ package net.corda.docs.java.tutorial.testdsl;
|
||||
|
||||
import kotlin.Unit;
|
||||
import net.corda.core.contracts.PartyAndReference;
|
||||
import net.corda.core.contracts.TransactionVerificationException;
|
||||
import net.corda.core.identity.CordaX500Name;
|
||||
import net.corda.finance.contracts.ICommercialPaperState;
|
||||
import net.corda.finance.contracts.JavaCommercialPaper;
|
||||
@ -43,7 +44,8 @@ public class CommercialPaperTest {
|
||||
// DOCEND 1
|
||||
|
||||
// DOCSTART 2
|
||||
@Test
|
||||
// This example test will fail with this exception.
|
||||
@Test(expected = IllegalStateException.class)
|
||||
public void simpleCP() {
|
||||
ICommercialPaperState inState = getPaper();
|
||||
ledger(ledgerServices, l -> {
|
||||
@ -58,7 +60,8 @@ public class CommercialPaperTest {
|
||||
// DOCEND 2
|
||||
|
||||
// DOCSTART 3
|
||||
@Test
|
||||
// This example test will fail with this exception.
|
||||
@Test(expected = TransactionVerificationException.ContractRejection.class)
|
||||
public void simpleCPMove() {
|
||||
ICommercialPaperState inState = getPaper();
|
||||
ledger(ledgerServices, l -> {
|
@ -2,6 +2,7 @@ package net.corda.docs.tutorial.testdsl
|
||||
|
||||
import com.nhaarman.mockito_kotlin.doReturn
|
||||
import com.nhaarman.mockito_kotlin.whenever
|
||||
import net.corda.core.contracts.TransactionVerificationException
|
||||
import net.corda.core.crypto.generateKeyPair
|
||||
import net.corda.core.identity.CordaX500Name
|
||||
import net.corda.core.utilities.days
|
||||
@ -53,7 +54,8 @@ class CommercialPaperTest {
|
||||
// DOCEND 1
|
||||
|
||||
// DOCSTART 2
|
||||
@Test
|
||||
// This example test will fail with this exception.
|
||||
@Test(expected = IllegalStateException::class)
|
||||
fun simpleCP() {
|
||||
val inState = getPaper()
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
||||
@ -67,7 +69,8 @@ class CommercialPaperTest {
|
||||
// DOCEND 2
|
||||
|
||||
// DOCSTART 3
|
||||
@Test
|
||||
// This example test will fail with this exception.
|
||||
@Test(expected = TransactionVerificationException.ContractRejection::class)
|
||||
fun simpleCPMove() {
|
||||
val inState = getPaper()
|
||||
ledgerServices.ledger(DUMMY_NOTARY) {
|
Reference in New Issue
Block a user