From ba92c1f3b1e4082f6c3a4a23d9fa35c581e36b0f Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 20 Sep 2024 17:16:05 -0700 Subject: [PATCH] Updated clicks summary test to match current API response --- examples/bld/src/.idea/workspace.xml | 8 -------- src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt | 9 +++++---- 2 files changed, 5 insertions(+), 12 deletions(-) delete mode 100644 examples/bld/src/.idea/workspace.xml diff --git a/examples/bld/src/.idea/workspace.xml b/examples/bld/src/.idea/workspace.xml deleted file mode 100644 index 43b4714..0000000 --- a/examples/bld/src/.idea/workspace.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - { - "keyToString": { - "settings.editor.selected.configurable": "reference.settings.ide.settings.new.ui" - } -} - \ No newline at end of file diff --git a/src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt b/src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt index 937bb69..9ad25af 100644 --- a/src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt +++ b/src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt @@ -180,12 +180,13 @@ class BitlyTest { fun `clicks summary`() { val bl = bitly.bitlinks() assertThat(bl.clicks(shortUrl)).isNotEqualTo(Constants.EMPTY) - bl.clicks(shortUrl, unit = Units.MONTH, units = 6) + val clicks = bl.clicks(shortUrl, unit = Units.MONTH, units = 1) assertThat(bl.lastCallResponse).all { - prop(CallResponse::isUpgradeRequired) - prop(CallResponse::statusCode).isEqualTo(402) - prop(CallResponse::description).startsWith("Metrics") + prop(CallResponse::isSuccessful).isTrue() + prop(CallResponse::statusCode).isEqualTo(200) + prop(CallResponse::description).isEmpty() } + assertThat(clicks.toInt()).isGreaterThanOrEqualTo(0) } @Test