Fix device transfer test dependent on native library.

fork-5.53.8
Cody Henthorne 2021-06-29 15:02:44 -04:00 zatwierdzone przez Alex Hart
rodzic c54c6018b2
commit 90a27d2227
7 zmienionych plików z 23 dodań i 9 usunięć

Wyświetl plik

@ -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'

Wyświetl plik

@ -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 {

Wyświetl plik

@ -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 {

Wyświetl plik

@ -38,4 +38,6 @@ dependencies {
}
testImplementation 'org.robolectric:shadows-multidex:4.4'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation(testFixtures(project(":libsignal-service")))
}

Wyświetl plik

@ -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();
}

Wyświetl plik

@ -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]
}
}

Wyświetl plik

@ -1,4 +1,4 @@
package org.thoughtcrime.securesms.testutil;
package org.whispersystems.signalservice.test;
import org.signal.client.internal.Native;