kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix device transfer test dependent on native library.
rodzic
c54c6018b2
commit
90a27d2227
|
@ -477,6 +477,8 @@ dependencies {
|
||||||
testImplementation 'org.robolectric:shadows-multidex:4.4'
|
testImplementation 'org.robolectric:shadows-multidex:4.4'
|
||||||
testImplementation 'org.hamcrest:hamcrest:2.2'
|
testImplementation 'org.hamcrest:hamcrest:2.2'
|
||||||
|
|
||||||
|
testImplementation(testFixtures(project(":libsignal-service")))
|
||||||
|
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.thoughtcrime.securesms.testutil.LibSignalLibraryUtil.assumeLibSignalSupportedOnOS;
|
|
||||||
import static org.thoughtcrime.securesms.testutil.ZkGroupLibraryUtil.assumeZkGroupSupportedOnOS;
|
import static org.thoughtcrime.securesms.testutil.ZkGroupLibraryUtil.assumeZkGroupSupportedOnOS;
|
||||||
|
import static org.whispersystems.signalservice.test.LibSignalLibraryUtil.assumeLibSignalSupportedOnOS;
|
||||||
|
|
||||||
@RunWith(Parameterized.class)
|
@RunWith(Parameterized.class)
|
||||||
public final class GroupId_v1_v2_migration_derivation_Test {
|
public final class GroupId_v1_v2_migration_derivation_Test {
|
||||||
|
|
|
@ -12,8 +12,7 @@ import org.whispersystems.signalservice.internal.push.SignalServiceProtos;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.whispersystems.signalservice.test.LibSignalLibraryUtil.assumeLibSignalSupportedOnOS;
|
||||||
import static org.thoughtcrime.securesms.testutil.LibSignalLibraryUtil.assumeLibSignalSupportedOnOS;
|
|
||||||
|
|
||||||
public final class MobileCoinPublicAddressProfileUtilTest {
|
public final class MobileCoinPublicAddressProfileUtilTest {
|
||||||
|
|
||||||
|
|
|
@ -38,4 +38,6 @@ dependencies {
|
||||||
}
|
}
|
||||||
testImplementation 'org.robolectric:shadows-multidex:4.4'
|
testImplementation 'org.robolectric:shadows-multidex:4.4'
|
||||||
testImplementation 'org.hamcrest:hamcrest:2.2'
|
testImplementation 'org.hamcrest:hamcrest:2.2'
|
||||||
|
|
||||||
|
testImplementation(testFixtures(project(":libsignal-service")))
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package org.signal.devicetransfer;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.signal.devicetransfer.DeviceTransferAuthentication.Client;
|
import org.signal.devicetransfer.DeviceTransferAuthentication.Client;
|
||||||
import org.signal.devicetransfer.DeviceTransferAuthentication.DeviceTransferAuthenticationException;
|
import org.signal.devicetransfer.DeviceTransferAuthentication.DeviceTransferAuthenticationException;
|
||||||
|
@ -13,14 +12,17 @@ import java.util.Random;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotEquals;
|
import static org.junit.Assert.assertNotEquals;
|
||||||
|
import static org.whispersystems.signalservice.test.LibSignalLibraryUtil.assumeLibSignalSupportedOnOS;
|
||||||
|
|
||||||
public class DeviceTransferAuthenticationTest {
|
public class DeviceTransferAuthenticationTest {
|
||||||
|
|
||||||
private static byte[] certificate;
|
private byte[] certificate;
|
||||||
private static byte[] badCertificate;
|
private byte[] badCertificate;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void ensureNativeSupported() throws KeyGenerationFailedException {
|
||||||
|
assumeLibSignalSupportedOnOS();
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void setup() throws KeyGenerationFailedException {
|
|
||||||
certificate = SelfSignedIdentity.create().getX509Encoded();
|
certificate = SelfSignedIdentity.create().getX509Encoded();
|
||||||
badCertificate = SelfSignedIdentity.create().getX509Encoded();
|
badCertificate = SelfSignedIdentity.create().getX509Encoded();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
apply plugin: 'java-library'
|
apply plugin: 'java-library'
|
||||||
|
apply plugin: 'java-test-fixtures'
|
||||||
apply plugin: 'com.google.protobuf'
|
apply plugin: 'com.google.protobuf'
|
||||||
apply plugin: 'maven'
|
apply plugin: 'maven'
|
||||||
apply plugin: 'signing'
|
apply plugin: 'signing'
|
||||||
|
@ -16,6 +17,10 @@ repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configurations {
|
||||||
|
ideaTestFixturesImplementation { extendsFrom testFixturesImplementation; canBeConsumed false; canBeResolved true }
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.google.protobuf:protobuf-javalite:3.10.0'
|
implementation 'com.google.protobuf:protobuf-javalite:3.10.0'
|
||||||
api 'com.googlecode.libphonenumber:libphonenumber:8.12.17'
|
api 'com.googlecode.libphonenumber:libphonenumber:8.12.17'
|
||||||
|
@ -30,6 +35,9 @@ dependencies {
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
testImplementation 'org.assertj:assertj-core:3.11.1'
|
testImplementation 'org.assertj:assertj-core:3.11.1'
|
||||||
testImplementation 'org.conscrypt:conscrypt-openjdk-uber:2.0.0'
|
testImplementation 'org.conscrypt:conscrypt-openjdk-uber:2.0.0'
|
||||||
|
|
||||||
|
testFixturesImplementation 'org.whispersystems:signal-client-java:0.8.1'
|
||||||
|
testFixturesImplementation 'junit:junit:4.12'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencyVerification {
|
dependencyVerification {
|
||||||
|
@ -60,6 +68,7 @@ protobuf {
|
||||||
idea {
|
idea {
|
||||||
module {
|
module {
|
||||||
generatedSourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java")
|
generatedSourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java")
|
||||||
|
scopes.COMPILE.plus += [configurations.ideaTestFixturesImplementation]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package org.thoughtcrime.securesms.testutil;
|
package org.whispersystems.signalservice.test;
|
||||||
|
|
||||||
import org.signal.client.internal.Native;
|
import org.signal.client.internal.Native;
|
||||||
|
|
Ładowanie…
Reference in New Issue