mirror of
https://github.com/corda/corda.git
synced 2024-12-19 04:57:58 +00:00
Remove unused test class (#4139)
This commit is contained in:
parent
f159629e36
commit
8ddd8d383d
@ -13,25 +13,22 @@ import kotlin.test.assertEquals
|
||||
import kotlin.test.assertFalse
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class ContractsDSLTests {
|
||||
class UnwantedCommand : CommandData
|
||||
class UnwantedCommand : CommandData
|
||||
|
||||
interface TestCommands : CommandData {
|
||||
interface TestCommands : CommandData {
|
||||
class CommandOne : TypeOnlyCommandData(), TestCommands
|
||||
class CommandTwo : TypeOnlyCommandData(), TestCommands
|
||||
}
|
||||
}
|
||||
|
||||
private companion object {
|
||||
val megaCorp = TestIdentity(CordaX500Name("MegaCorp", "London", "GB"))
|
||||
val miniCorp = TestIdentity(CordaX500Name("MiniCorp", "London", "GB"))
|
||||
val megaCorp = TestIdentity(CordaX500Name("MegaCorp", "London", "GB"))
|
||||
val miniCorp = TestIdentity(CordaX500Name("MiniCorp", "London", "GB"))
|
||||
|
||||
val validCommandOne = CommandWithParties(listOf(megaCorp.publicKey, miniCorp.publicKey), listOf(megaCorp.party, miniCorp.party), TestCommands.CommandOne())
|
||||
val validCommandTwo = CommandWithParties(listOf(megaCorp.publicKey), listOf(megaCorp.party), TestCommands.CommandTwo())
|
||||
val invalidCommand = CommandWithParties(emptyList(), emptyList(), UnwantedCommand())
|
||||
}
|
||||
val validCommandOne = CommandWithParties(listOf(megaCorp.publicKey, miniCorp.publicKey), listOf(megaCorp.party, miniCorp.party), TestCommands.CommandOne())
|
||||
val validCommandTwo = CommandWithParties(listOf(megaCorp.publicKey), listOf(megaCorp.party), TestCommands.CommandTwo())
|
||||
val invalidCommand = CommandWithParties(emptyList(), emptyList(), UnwantedCommand())
|
||||
|
||||
@RunWith(Parameterized::class)
|
||||
class RequireSingleCommandTests(private val testFunction: (Collection<CommandWithParties<CommandData>>) -> CommandWithParties<CommandData>,
|
||||
@RunWith(Parameterized::class)
|
||||
class RequireSingleCommandTests(private val testFunction: (Collection<CommandWithParties<CommandData>>) -> CommandWithParties<CommandData>,
|
||||
@Suppress("UNUSED_PARAMETER") description: String) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@ -60,12 +57,12 @@ class ContractsDSLTests {
|
||||
val commands = listOf(invalidCommand)
|
||||
Assertions.assertThatThrownBy { testFunction(commands) }
|
||||
.isInstanceOf(IllegalStateException::class.java)
|
||||
.hasMessage("Required net.corda.core.contracts.ContractsDSLTests.TestCommands command")
|
||||
}
|
||||
.hasMessage("Required net.corda.core.contracts.TestCommands command")
|
||||
}
|
||||
}
|
||||
|
||||
@RunWith(Parameterized::class)
|
||||
class SelectWithSingleInputsTests(private val testFunction: (Collection<CommandWithParties<CommandData>>, PublicKey?, AbstractParty?) -> Iterable<CommandWithParties<CommandData>>,
|
||||
@RunWith(Parameterized::class)
|
||||
class SelectWithSingleInputsTests(private val testFunction: (Collection<CommandWithParties<CommandData>>, PublicKey?, AbstractParty?) -> Iterable<CommandWithParties<CommandData>>,
|
||||
@Suppress("UNUSED_PARAMETER") description: String) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@ -111,10 +108,10 @@ class ContractsDSLTests {
|
||||
assertTrue(filteredCommands.contains(validCommandOne))
|
||||
assertFalse(filteredCommands.contains(validCommandTwo))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RunWith(Parameterized::class)
|
||||
class SelectWithMultipleInputsTests(private val testFunction: (Collection<CommandWithParties<CommandData>>, Collection<PublicKey>?, Collection<Party>?) -> Iterable<CommandWithParties<CommandData>>,
|
||||
@RunWith(Parameterized::class)
|
||||
class SelectWithMultipleInputsTests(private val testFunction: (Collection<CommandWithParties<CommandData>>, Collection<PublicKey>?, Collection<Party>?) -> Iterable<CommandWithParties<CommandData>>,
|
||||
@Suppress("UNUSED_PARAMETER") description: String) {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@ -178,5 +175,4 @@ class ContractsDSLTests {
|
||||
assertTrue(filteredCommands.contains(validCommandOne))
|
||||
assertFalse(filteredCommands.contains(validCommandTwo))
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user