Added CallResponse and Bitlinks.udpate().
This commit is contained in:
parent
318409cb2f
commit
4ca3773fe9
19 changed files with 32 additions and 18 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"))
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue