clean
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package com.rssuper.services
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNotNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class HTTPAuthCredentialsTest {
|
||||
|
||||
@Test
|
||||
fun testBasicAuthCredentials() {
|
||||
val auth = HTTPAuthCredentials("username", "password")
|
||||
val credentials = auth.toCredentials()
|
||||
|
||||
assertNotNull(credentials)
|
||||
assertTrue(credentials.startsWith("Basic "))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testBasicAuthCredentialsWithSpecialChars() {
|
||||
val auth = HTTPAuthCredentials("user@domain", "pass!@#")
|
||||
val credentials = auth.toCredentials()
|
||||
|
||||
assertNotNull(credentials)
|
||||
assertTrue(credentials.startsWith("Basic "))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testUsernameAndPassword() {
|
||||
val auth = HTTPAuthCredentials("testuser", "testpass")
|
||||
|
||||
assertEquals("testuser", auth.username)
|
||||
assertEquals("testpass", auth.password)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testEmptyUsername() {
|
||||
val auth = HTTPAuthCredentials("", "password")
|
||||
val credentials = auth.toCredentials()
|
||||
|
||||
assertNotNull(credentials)
|
||||
assertTrue(credentials.startsWith("Basic "))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testEmptyPassword() {
|
||||
val auth = HTTPAuthCredentials("username", "")
|
||||
val credentials = auth.toCredentials()
|
||||
|
||||
assertNotNull(credentials)
|
||||
assertTrue(credentials.startsWith("Basic "))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user