CORPRIV-699: Use platform-specific separator.

This commit is contained in:
Chris Rankin 2017-03-01 14:44:35 +00:00
parent 438fc97881
commit a7d456be15

View File

@ -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)
}
}