ENT-11351 - Compiler warnings pass 2 (#7655)

* Addressed compiler warnings

* Removed unchecked cast fixes - not for this PR

* Sorted out detekt issues
This commit is contained in:
Chris Cochrane
2024-01-23 10:19:03 +00:00
committed by GitHub
parent a0ce265b35
commit f15e6ec56a
20 changed files with 113 additions and 125 deletions

View File

@ -40,7 +40,7 @@ import org.junit.After
import org.junit.AfterClass
import org.junit.Rule
import org.junit.Test
import org.junit.rules.ExpectedException
import org.junit.jupiter.api.assertThrows
import org.junit.rules.TemporaryFolder
import java.nio.file.Files
import java.nio.file.Path
@ -54,16 +54,13 @@ import kotlin.io.path.readBytes
import kotlin.io.path.useDirectoryEntries
import kotlin.io.path.writeBytes
import kotlin.io.path.writeText
import kotlin.test.assertEquals
class NetworkBootstrapperTest {
@Rule
@JvmField
val tempFolder = TemporaryFolder()
@Rule
@JvmField
val expectedEx: ExpectedException = ExpectedException.none()
@Rule
@JvmField
val testSerialization = SerializationEnvironmentRule()
@ -304,9 +301,10 @@ class NetworkBootstrapperTest {
assertContainsPackageOwner("alice", mapOf(Pair(greedyNamespace, alice.publicKey)))
// register overlapping package name
createNodeConfFile("bob", bobConfig)
expectedEx.expect(IllegalArgumentException::class.java)
expectedEx.expectMessage("Multiple packages added to the packageOwnership overlap.")
bootstrap(packageOwnership = mapOf(Pair(greedyNamespace, alice.publicKey), Pair(bobPackageName, bob.publicKey)))
val anException = assertThrows<IllegalArgumentException> {
bootstrap(packageOwnership = mapOf(Pair(greedyNamespace, alice.publicKey), Pair(bobPackageName, bob.publicKey)))
}
assertEquals("Multiple packages added to the packageOwnership overlap.", anException.message)
}
@Test(timeout=300_000)