Added bitlinks tests.
This commit is contained in:
parent
06ea6b91a2
commit
64e9eb2f55
2 changed files with 13 additions and 0 deletions
|
@ -2,8 +2,11 @@
|
|||
<SmellBaseline>
|
||||
<Blacklist></Blacklist>
|
||||
<Whitelist>
|
||||
<ID>ComplexMethod:Utils.kt$Utils.Companion$call</ID>
|
||||
<ID>FunctionParameterNaming:Bitlinks.kt$Bitlinks$bitlink_id: String</ID>
|
||||
<ID>FunctionParameterNaming:Bitlinks.kt$Bitlinks$group_guid: String = Constants.EMPTY</ID>
|
||||
<ID>FunctionParameterNaming:Bitlinks.kt$Bitlinks$long_url: String</ID>
|
||||
<ID>NestedBlockDepth:Utils.kt$Utils.Companion$call</ID>
|
||||
<ID>NestedBlockDepth:Utils.kt$Utils.Companion$parseBody</ID>
|
||||
</Whitelist>
|
||||
</SmellBaseline>
|
||||
|
|
|
@ -92,4 +92,14 @@ class BitlyTest {
|
|||
fun `get user`() {
|
||||
assertTrue(bitly.call(Utils.buildEndPointUrl("user"), emptyMap(), Methods.GET).contains("\"login\":"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `bitlinks shorten`() {
|
||||
assertEquals(shortUrl, Bitlinks(bitly.accessToken).shorten(longUrl, domain="bit.ly"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `bitlinks expand`() {
|
||||
assertEquals(longUrl, Bitlinks(bitly.accessToken).expand(shortUrl))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue