From 725ea3b23bed78c3fab249361e6e28a211c123bf Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 29 Jan 2023 18:30:51 -0800 Subject: [PATCH] Added more tests --- src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt b/src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt index 1788fd6..1f45041 100644 --- a/src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt +++ b/src/test/kotlin/net/thauvin/erik/bitly/BitlyTest.kt @@ -197,6 +197,12 @@ class BitlyTest { bl.update(shortUrl, link = longUrl) assertThat(bl.lastCallResponse).prop(CallResponse::isUnprocessableEntity).isTrue() + + bl.update("bit.ly/407GjJU", id = "foo") + assertThat(bl.lastCallResponse).all { + prop(CallResponse::isForbidden).isTrue() + prop(CallResponse::resultCode).isEqualTo(403) + } } @Test @@ -224,7 +230,10 @@ class BitlyTest { }.build() bl.update(config) - assertThat(bl.lastCallResponse).prop(CallResponse::isUnprocessableEntity).isTrue() + assertThat(bl.lastCallResponse).all { + prop(CallResponse::isUnprocessableEntity).isTrue() + prop(CallResponse::resultCode).isEqualTo(422) + } } @Test