Skip to content

Instantly share code, notes, and snippets.

@ZieIony
Created April 23, 2021 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZieIony/e18c2115eab969c09738113c0ab8d8cd to your computer and use it in GitHub Desktop.
Save ZieIony/e18c2115eab969c09738113c0ab8d8cd to your computer and use it in GitHub Desktop.
@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