From 3dc0f2902eb8f68eedbcb77c0581a3ebac51fc13 Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Thu, 4 Apr 2019 10:36:17 -0700 Subject: [PATCH] Added more constructors tests. --- .../net/thauvin/erik/pinboard/PinboardPosterTest.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/test/kotlin/net/thauvin/erik/pinboard/PinboardPosterTest.kt b/src/test/kotlin/net/thauvin/erik/pinboard/PinboardPosterTest.kt index d38da95..45895c8 100644 --- a/src/test/kotlin/net/thauvin/erik/pinboard/PinboardPosterTest.kt +++ b/src/test/kotlin/net/thauvin/erik/pinboard/PinboardPosterTest.kt @@ -33,7 +33,9 @@ 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 class PinboardPosterTest { private val url = "http://www.foo.com/" @@ -58,11 +60,18 @@ class PinboardPosterTest { @Test fun testDeletePin() { - val poster = PinboardPoster(localProps) + val props = Properties().apply { + Files.newInputStream(localProps).use { nis -> + load(nis) + } + } + var poster = PinboardPoster(props) poster.apiEndPoint = "" Assert.assertFalse(poster.deletePin(url), "apiEndPoint: ") + poster = PinboardPoster(localProps, Constants.ENV_API_TOKEN) + poster.apiEndPoint = Constants.API_ENDPOINT Assert.assertTrue(poster.deletePin(url), "apiEndPoint: ${Constants.API_ENDPOINT}")