diff --git a/core/src/main/kotlin/com/r3corda/core/testing/Generators.kt b/core/src/main/kotlin/com/r3corda/core/testing/Generators.kt index 20714593cb..cea99ce2eb 100644 --- a/core/src/main/kotlin/com/r3corda/core/testing/Generators.kt +++ b/core/src/main/kotlin/com/r3corda/core/testing/Generators.kt @@ -63,18 +63,21 @@ class StateRefGenerator: Generator(StateRef::class.java) { } } +@Suppress("CAST_NEVER_SUCCEEDS") class TransactionStateGenerator(val stateGenerator: Generator) : Generator>(TransactionState::class.java as Class>) { override fun generate(random: SourceOfRandomness, status: GenerationStatus): TransactionState { return TransactionState(stateGenerator.generate(random, status), PartyGenerator().generate(random, status)) } } +@Suppress("CAST_NEVER_SUCCEEDS") class IssuedGenerator(val productGenerator: Generator) : Generator>(Issued::class.java as Class>) { override fun generate(random: SourceOfRandomness, status: GenerationStatus): Issued { return Issued(PartyAndReferenceGenerator().generate(random, status), productGenerator.generate(random, status)) } } +@Suppress("CAST_NEVER_SUCCEEDS") class AmountGenerator(val tokenGenerator: Generator) : Generator>(Amount::class.java as Class>) { override fun generate(random: SourceOfRandomness, status: GenerationStatus): Amount { return Amount(random.nextLong(0, 1000000), tokenGenerator.generate(random, status))