mirror of
https://github.com/VinylDNS/vinyldns
synced 2025-08-22 02:02:14 +00:00
Merge pull request #1171 from Aravindh-Raju/aravindhr/override-toString-ZoneConnection
Override ZoneConnection toString
This commit is contained in:
commit
c6bca186b6
@ -241,5 +241,15 @@ class ZoneConnectionValidatorSpec
|
||||
underTest.isValidBackendId(Some("bad")) shouldBe left
|
||||
}
|
||||
}
|
||||
|
||||
"Zone Connection toString" should {
|
||||
"not display key and algorithm" in {
|
||||
zc.toString shouldBe "ZoneConnection: [name=\"zc.\"; keyName=\"zc.\"; primaryServer=\"10.1.1.1\"; ]"
|
||||
}
|
||||
"not display key and algorithm while displaying connection and transferConnection of a Zone" in {
|
||||
val zoneString = s"""Zone: [id="${testZone.id}"; name="vinyldns."; account="system"; adminGroupId="system"; status="Active"; shared="false"; connection="Some(ZoneConnection: [name="vinyldns."; keyName="vinyldns."; primaryServer="10.1.1.1"; ])"; transferConnection="Some(ZoneConnection: [name="vinyldns."; keyName="vinyldns."; primaryServer="10.1.1.1"; ])"; reverse="false"; isTest="false"; created="${testZone.created}"; ]"""
|
||||
testZone.toString shouldBe zoneString
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -188,6 +188,16 @@ case class ZoneConnection(
|
||||
|
||||
def decrypted(crypto: CryptoAlgebra): ZoneConnection =
|
||||
copy(key = crypto.decrypt(key))
|
||||
|
||||
override def toString: String = {
|
||||
val sb = new StringBuilder
|
||||
sb.append("ZoneConnection: [")
|
||||
sb.append("name=\"").append(name).append("\"; ")
|
||||
sb.append("keyName=\"").append(keyName).append("\"; ")
|
||||
sb.append("primaryServer=\"").append(primaryServer).append("\"; ")
|
||||
sb.append("]")
|
||||
sb.toString
|
||||
}
|
||||
}
|
||||
|
||||
final case class LegacyDnsBackend(
|
||||
|
Loading…
x
Reference in New Issue
Block a user