Fix device transfer test dependent on native library.
This commit is contained in:
parent
c54c6018b2
commit
90a27d2227
7 changed files with 23 additions and 9 deletions
|
@ -477,6 +477,8 @@ dependencies {
|
|||
testImplementation 'org.robolectric:shadows-multidex:4.4'
|
||||
testImplementation 'org.hamcrest:hamcrest:2.2'
|
||||
|
||||
testImplementation(testFixtures(project(":libsignal-service")))
|
||||
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
|
||||
|
|
|
@ -11,8 +11,8 @@ import java.util.Arrays;
|
|||
import java.util.Collection;
|
||||
|
||||
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.whispersystems.signalservice.test.LibSignalLibraryUtil.assumeLibSignalSupportedOnOS;
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
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.junit.Assert.assertArrayEquals;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.thoughtcrime.securesms.testutil.LibSignalLibraryUtil.assumeLibSignalSupportedOnOS;
|
||||
import static org.whispersystems.signalservice.test.LibSignalLibraryUtil.assumeLibSignalSupportedOnOS;
|
||||
|
||||
public final class MobileCoinPublicAddressProfileUtilTest {
|
||||
|
||||
|
|
|
@ -38,4 +38,6 @@ dependencies {
|
|||
}
|
||||
testImplementation 'org.robolectric:shadows-multidex:4.4'
|
||||
testImplementation 'org.hamcrest:hamcrest:2.2'
|
||||
|
||||
testImplementation(testFixtures(project(":libsignal-service")))
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.signal.devicetransfer;
|
|||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.signal.devicetransfer.DeviceTransferAuthentication.Client;
|
||||
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.assertNotEquals;
|
||||
import static org.whispersystems.signalservice.test.LibSignalLibraryUtil.assumeLibSignalSupportedOnOS;
|
||||
|
||||
public class DeviceTransferAuthenticationTest {
|
||||
|
||||
private static byte[] certificate;
|
||||
private static byte[] badCertificate;
|
||||
private byte[] certificate;
|
||||
private byte[] badCertificate;
|
||||
|
||||
@Before
|
||||
public void ensureNativeSupported() throws KeyGenerationFailedException {
|
||||
assumeLibSignalSupportedOnOS();
|
||||
|
||||
@BeforeClass
|
||||
public static void setup() throws KeyGenerationFailedException {
|
||||
certificate = SelfSignedIdentity.create().getX509Encoded();
|
||||
badCertificate = SelfSignedIdentity.create().getX509Encoded();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
apply plugin: 'java-library'
|
||||
apply plugin: 'java-test-fixtures'
|
||||
apply plugin: 'com.google.protobuf'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'signing'
|
||||
|
@ -16,6 +17,10 @@ repositories {
|
|||
mavenLocal()
|
||||
}
|
||||
|
||||
configurations {
|
||||
ideaTestFixturesImplementation { extendsFrom testFixturesImplementation; canBeConsumed false; canBeResolved true }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.google.protobuf:protobuf-javalite:3.10.0'
|
||||
api 'com.googlecode.libphonenumber:libphonenumber:8.12.17'
|
||||
|
@ -30,6 +35,9 @@ dependencies {
|
|||
testImplementation 'junit:junit:4.12'
|
||||
testImplementation 'org.assertj:assertj-core:3.11.1'
|
||||
testImplementation 'org.conscrypt:conscrypt-openjdk-uber:2.0.0'
|
||||
|
||||
testFixturesImplementation 'org.whispersystems:signal-client-java:0.8.1'
|
||||
testFixturesImplementation 'junit:junit:4.12'
|
||||
}
|
||||
|
||||
dependencyVerification {
|
||||
|
@ -60,6 +68,7 @@ protobuf {
|
|||
idea {
|
||||
module {
|
||||
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;
|
||||
|
Loading…
Add table
Reference in a new issue