mirror of
https://github.com/corda/corda.git
synced 2024-12-29 09:18:58 +00:00
Merged in corpriv-699 (pull request #24)
CORPRIV-699: Use platform-specific separator. Approved-by: Shams Asari
This commit is contained in:
commit
39dacac330
@ -1,20 +1,24 @@
|
||||
package com.r3.corda.doorman
|
||||
|
||||
import org.junit.Test
|
||||
import java.io.File
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class DoormanParametersTest {
|
||||
|
||||
private val testDummyPath = ".${File.separator}testDummyPath.jks"
|
||||
|
||||
@Test
|
||||
fun `parse arg correctly`() {
|
||||
val params = DoormanParameters(arrayOf("--keygen", "--keystorePath", "./testDummyPath.jks"))
|
||||
val params = DoormanParameters(arrayOf("--keygen", "--keystorePath", testDummyPath))
|
||||
assertEquals(DoormanParameters.Mode.CA_KEYGEN, params.mode)
|
||||
assertEquals("./testDummyPath.jks", params.keystorePath.toString())
|
||||
assertEquals(testDummyPath, params.keystorePath.toString())
|
||||
assertEquals(0, params.port)
|
||||
|
||||
val params2 = DoormanParameters(arrayOf("--keystorePath", "./testDummyPath.jks", "--port", "1000"))
|
||||
val params2 = DoormanParameters(arrayOf("--keystorePath", testDummyPath, "--port", "1000"))
|
||||
assertEquals(DoormanParameters.Mode.DOORMAN, params2.mode)
|
||||
assertEquals("./testDummyPath.jks", params2.keystorePath.toString())
|
||||
assertEquals(testDummyPath, params2.keystorePath.toString())
|
||||
assertEquals(1000, params2.port)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user