Add unit test for build-logic static ip tool.
This commit is contained in:
parent
43aad90ee4
commit
3f62221182
2 changed files with 19 additions and 6 deletions
|
@ -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"}
|
||||
|
|
|
@ -64,6 +64,8 @@ task qa {
|
|||
group 'Verification'
|
||||
description 'Quality Assurance. Run before pushing.'
|
||||
dependsOn 'clean',
|
||||
gradle.includedBuild('build-logic').task(':tools:test'),
|
||||
gradle.includedBuild('build-logic').task(':tools:ktlintCheck'),
|
||||
':Signal-Android:testPlayProdReleaseUnitTest',
|
||||
':Signal-Android:lintPlayProdRelease',
|
||||
'Signal-Android:ktlintCheck',
|
||||
|
|
Loading…
Add table
Reference in a new issue