Implemented lastCallResponse property. Closes #2
This commit is contained in:
parent
683cb3aa35
commit
b12931c6ad
10 changed files with 53 additions and 19 deletions
|
@ -123,6 +123,15 @@ class BitlyTest {
|
|||
assertEquals(longUrl, Bitlinks(bitly.accessToken).expand(shortUrl))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `bitlinks lastCallResponse`() {
|
||||
val bl = Bitlinks(bitly.accessToken)
|
||||
bl.shorten(longUrl, domain="bit.ly")
|
||||
assertEquals(true, bl.lastCallResponse.isSuccessful, "is successful")
|
||||
assertEquals(200, bl.lastCallResponse.resultCode, "resultCode == 200")
|
||||
assertTrue(bl.lastCallResponse.body.contains("\"link\":\"$shortUrl\""), "valid body")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `clicks summary`() {
|
||||
assertNotEquals(Constants.EMPTY, bitly.bitlinks().clicks(shortUrl))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue