Fix test for CI.
This commit is contained in:
parent
3e71a1216e
commit
08868de3d7
1 changed files with 9 additions and 3 deletions
|
@ -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 = ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue