Fix test for CI.

This commit is contained in:
Erik C. Thauvin 2019-04-04 15:31:39 -07:00
parent 3e71a1216e
commit 08868de3d7

View file

@ -33,6 +33,7 @@ package net.thauvin.erik.pinboard
import org.testng.Assert import org.testng.Assert
import org.testng.annotations.Test import org.testng.annotations.Test
import java.nio.file.Files import java.nio.file.Files
import java.nio.file.Paths import java.nio.file.Paths
import java.util.Properties import java.util.Properties
@ -60,11 +61,16 @@ class PinboardPosterTest {
@Test @Test
fun testDeletePin() { fun testDeletePin() {
val props = Properties().apply { val props = if (Files.exists(localProps)) {
Files.newInputStream(localProps).use { nis -> Properties().apply {
load(nis) Files.newInputStream(localProps).use { nis -> load(nis) }
}
} else {
Properties().apply {
setProperty(Constants.ENV_API_TOKEN, System.getenv(Constants.ENV_API_TOKEN))
} }
} }
var poster = PinboardPoster(props) var poster = PinboardPoster(props)
poster.apiEndPoint = "" poster.apiEndPoint = ""