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.annotations.Test
import java.nio.file.Files
import java.nio.file.Paths
import java.util.Properties
@ -60,11 +61,16 @@ class PinboardPosterTest {
@Test
fun testDeletePin() {
val props = Properties().apply {
Files.newInputStream(localProps).use { nis ->
load(nis)
val props = if (Files.exists(localProps)) {
Properties().apply {
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)
poster.apiEndPoint = ""