mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 21:15:48 +00:00
Add unit test for build-logic static ip tool.
This commit is contained in:
committed by
Greyson Parrelli
parent
43aad90ee4
commit
3f62221182
@@ -20,12 +20,23 @@ class StaticIpResolverTest {
|
||||
|
||||
@Test
|
||||
fun `Given a hostname with records, when I resolveToBuildConfig, then I expect a matching IP`() {
|
||||
val staticIpResolver = StaticIpResolver(FakeRecordFetcher(mapOf(
|
||||
SIGNAL_DOT_ORG to arrayOf(ARecord(Name.fromString("www."), DClass.ANY, 0L, mockk<Inet4Address> {
|
||||
every { address } returns SIGNAL_IP
|
||||
every { hostAddress } returns STRINGIFIED_IP
|
||||
}))
|
||||
)))
|
||||
val staticIpResolver = StaticIpResolver(
|
||||
FakeRecordFetcher(
|
||||
mapOf(
|
||||
SIGNAL_DOT_ORG to arrayOf(
|
||||
ARecord(
|
||||
Name.fromString("www."),
|
||||
DClass.ANY,
|
||||
0L,
|
||||
mockk<Inet4Address> {
|
||||
every { address } returns SIGNAL_IP
|
||||
every { hostAddress } returns STRINGIFIED_IP
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
val actual = staticIpResolver.resolveToBuildConfig(SIGNAL_DOT_ORG)
|
||||
val expected = """
|
||||
new String[]{"$STRINGIFIED_IP"}
|
||||
|
||||
Reference in New Issue
Block a user