mirror of https://github.com/sbt/sbt.git
Dont quote realm if it's null in Credentials.toString
This commit is contained in:
parent
0028ecf058
commit
956e8483f5
|
|
@ -88,5 +88,11 @@ final class DirectCredentials(
|
|||
val userName: String,
|
||||
val passwd: String
|
||||
) extends Credentials {
|
||||
override def toString = s"""DirectCredentials("$realm", "$host", "$userName", ****)"""
|
||||
override def toString = {
|
||||
val dq = '"'
|
||||
val r =
|
||||
if (realm == null) "null"
|
||||
else dq + realm + dq
|
||||
s"""DirectCredentials($r, "$host", "$userName", ****)"""
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,4 +25,16 @@ class CredentialsSpec extends AnyFunSuite {
|
|||
|
||||
credentialsFile.delete()
|
||||
}
|
||||
|
||||
test("DirectCredentials.toString") {
|
||||
assert(
|
||||
Credentials(realm = null, host = "example.org", userName = "username", passwd = "password").toString ==
|
||||
"""DirectCredentials(null, "example.org", "username", ****)"""
|
||||
)
|
||||
|
||||
assert(
|
||||
Credentials(realm = "realm", host = "example.org", userName = "username", passwd = "password").toString ==
|
||||
"""DirectCredentials("realm", "example.org", "username", ****)"""
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue