[EG-503] Test cases for exposed notaryService (#6161)

This commit is contained in:
Ramzi El-Yafi 2020-04-17 16:51:27 +01:00 committed by GitHub
parent e5d554571f
commit 45b43f116d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -72,6 +72,15 @@ class NodeTest {
}
}
@Test(timeout=300_000)
fun `check node service availability`() {
val configuration = createConfig(ALICE_NAME)
val info = VersionInfo(789, "3.0", "SNAPSHOT", "R3")
val node = Node(configuration, info, initialiseSerialization = false)
// Regular nodes must not have internal access to the notary service
assertNull(node.services.notaryService)
}
@Test(timeout=300_000)
fun `clear network map cache works`() {
val configuration = createConfig(ALICE_NAME)

View File

@ -24,6 +24,7 @@ import org.junit.After
import org.junit.Before
import org.junit.Test
import kotlin.test.assertFailsWith
import kotlin.test.assertNotNull
class NotaryServiceTests {
private lateinit var mockNet: InternalMockNetwork
@ -55,6 +56,11 @@ class NotaryServiceTests {
notariseWithTooManyInputs(aliceNode, alice, notary, mockNet)
}
@Test(timeout=300_000)
fun `notary node should have access to its notary service`() {
assertNotNull(mockNet.defaultNotaryNode.notaryService)
}
@Test(timeout=300_000)
fun `should reject when network parameters component is not visible`() {
val stx = generateTransaction(aliceNode, alice, notary, null, 13)