Created
April 23, 2021 22:20
-
-
Save ZieIony/e18c2115eab969c09738113c0ab8d8cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun testProperties() { | |
val fileContent = """ | |
slack.token=asdf | |
""".trimIndent() | |
val properties = Properties() | |
properties.load(ByteArrayInputStream(fileContent.toByteArray())) | |
val toolsProperties = ToolsProperties.parseProperties(properties) | |
Assert.assertEquals("asdf", toolsProperties.slackToken) | |
} | |
@Test | |
fun testPropertiesMissing() { | |
val fileContent = "" | |
val properties = Properties() | |
properties.load(ByteArrayInputStream(fileContent.toByteArray())) | |
Assert.assertThrows(MissingPropertyException::class.java, { | |
ToolsProperties.parseProperties(properties) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment