diff --git a/libs/state-manager/state-manager-api/src/test/kotlin/net/corda/libs/statemanager/api/MetadataTests.kt b/libs/state-manager/state-manager-api/src/test/kotlin/net/corda/libs/statemanager/api/MetadataTests.kt index 8f07513fe3c..337b3130483 100644 --- a/libs/state-manager/state-manager-api/src/test/kotlin/net/corda/libs/statemanager/api/MetadataTests.kt +++ b/libs/state-manager/state-manager-api/src/test/kotlin/net/corda/libs/statemanager/api/MetadataTests.kt @@ -1,9 +1,9 @@ package net.corda.libs.statemanager.api import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.api.Assertions.assertThatThrownBy import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow -import org.junit.jupiter.api.assertThrows import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.MethodSource import java.util.stream.Stream @@ -29,10 +29,9 @@ class MetadataTests { @Test fun `fail all non-primitive types`() { val list = listOf("Na Na Na Na Na Na Na Na", "Batman") - val ex = assertThrows { - Metadata(mapOf("joker" to Superman(1000), "batman" to list)) - } - assertThat(ex).hasMessageContainingAll("joker", "batman", Superman::class.java.name, list.javaClass.name) + assertThatThrownBy { Metadata(mapOf("joker" to Superman(1000), "batman" to list)) } + .isExactlyInstanceOf(IllegalArgumentException::class.java) + .hasMessageContainingAll("joker", "batman", Superman::class.java.name, list.javaClass.name) } @Test