Added CallResponse and Bitlinks.udpate().

This commit is contained in:
Erik C. Thauvin 2020-03-03 13:25:04 -08:00
parent 318409cb2f
commit 4ca3773fe9
19 changed files with 32 additions and 18 deletions

View file

@ -235,7 +235,7 @@ open class Bitlinks(private val accessToken: String) {
id: String = Constants.EMPTY,
toJson: Boolean = false
): String {
var result = if (toJson) Constants.EMPTY_JSON else "false"
var result = if (toJson) Constants.EMPTY_JSON else Constants.FALSE
if (bitlink.isNotBlank()) {
val response = Utils.call(
accessToken, "/bitlinks/${bitlink.removeHttp()}".toEndPoint(), mutableMapOf<String, Any>().apply {
@ -259,7 +259,7 @@ open class Bitlinks(private val accessToken: String) {
result = if (toJson) {
response.body
} else {
"true"
Constants.TRUE
}
}
}

View file

@ -141,7 +141,7 @@ class BitlyTest {
@Test
fun `update bitlink`() {
assertEquals(
true.toString(),
Constants.TRUE,
bitly.bitlinks().update(shortUrl, title = "Erik's Weblog", tags = arrayOf("blog", "weblog"))
)
}