kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add unit test for build-logic static ip tool.
rodzic
43aad90ee4
commit
3f62221182
|
@ -20,12 +20,23 @@ class StaticIpResolverTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `Given a hostname with records, when I resolveToBuildConfig, then I expect a matching IP`() {
|
fun `Given a hostname with records, when I resolveToBuildConfig, then I expect a matching IP`() {
|
||||||
val staticIpResolver = StaticIpResolver(FakeRecordFetcher(mapOf(
|
val staticIpResolver = StaticIpResolver(
|
||||||
SIGNAL_DOT_ORG to arrayOf(ARecord(Name.fromString("www."), DClass.ANY, 0L, mockk<Inet4Address> {
|
FakeRecordFetcher(
|
||||||
every { address } returns SIGNAL_IP
|
mapOf(
|
||||||
every { hostAddress } returns STRINGIFIED_IP
|
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 actual = staticIpResolver.resolveToBuildConfig(SIGNAL_DOT_ORG)
|
||||||
val expected = """
|
val expected = """
|
||||||
new String[]{"$STRINGIFIED_IP"}
|
new String[]{"$STRINGIFIED_IP"}
|
||||||
|
|
|
@ -64,6 +64,8 @@ task qa {
|
||||||
group 'Verification'
|
group 'Verification'
|
||||||
description 'Quality Assurance. Run before pushing.'
|
description 'Quality Assurance. Run before pushing.'
|
||||||
dependsOn 'clean',
|
dependsOn 'clean',
|
||||||
|
gradle.includedBuild('build-logic').task(':tools:test'),
|
||||||
|
gradle.includedBuild('build-logic').task(':tools:ktlintCheck'),
|
||||||
':Signal-Android:testPlayProdReleaseUnitTest',
|
':Signal-Android:testPlayProdReleaseUnitTest',
|
||||||
':Signal-Android:lintPlayProdRelease',
|
':Signal-Android:lintPlayProdRelease',
|
||||||
'Signal-Android:ktlintCheck',
|
'Signal-Android:ktlintCheck',
|
||||||
|
|
Ładowanie…
Reference in New Issue