Clarify parameterized tests by modifying prototype request objects; remove spurious warning suppressions
This commit is contained in:
parent
a131f2116f
commit
b01945ff50
|
@ -152,7 +152,7 @@ class KeysAnonymousGrpcServiceTest {
|
||||||
when(accountsManager.getByServiceIdentifierAsync(new AciServiceIdentifier(identifier)))
|
when(accountsManager.getByServiceIdentifierAsync(new AciServiceIdentifier(identifier)))
|
||||||
.thenReturn(CompletableFuture.completedFuture(Optional.of(targetAccount)));
|
.thenReturn(CompletableFuture.completedFuture(Optional.of(targetAccount)));
|
||||||
|
|
||||||
@SuppressWarnings("ResultOfMethodCallIgnored") final StatusRuntimeException statusRuntimeException =
|
final StatusRuntimeException statusRuntimeException =
|
||||||
assertThrows(StatusRuntimeException.class,
|
assertThrows(StatusRuntimeException.class,
|
||||||
() -> keysAnonymousStub.getPreKeys(GetPreKeysAnonymousRequest.newBuilder()
|
() -> keysAnonymousStub.getPreKeys(GetPreKeysAnonymousRequest.newBuilder()
|
||||||
.setRequest(GetPreKeysRequest.newBuilder()
|
.setRequest(GetPreKeysRequest.newBuilder()
|
||||||
|
@ -172,7 +172,7 @@ class KeysAnonymousGrpcServiceTest {
|
||||||
when(accountsManager.getByServiceIdentifierAsync(any()))
|
when(accountsManager.getByServiceIdentifierAsync(any()))
|
||||||
.thenReturn(CompletableFuture.completedFuture(Optional.empty()));
|
.thenReturn(CompletableFuture.completedFuture(Optional.empty()));
|
||||||
|
|
||||||
@SuppressWarnings("ResultOfMethodCallIgnored") final StatusRuntimeException exception =
|
final StatusRuntimeException exception =
|
||||||
assertThrows(StatusRuntimeException.class,
|
assertThrows(StatusRuntimeException.class,
|
||||||
() -> keysAnonymousStub.getPreKeys(GetPreKeysAnonymousRequest.newBuilder()
|
() -> keysAnonymousStub.getPreKeys(GetPreKeysAnonymousRequest.newBuilder()
|
||||||
.setUnidentifiedAccessKey(UUIDUtil.toByteString(UUID.randomUUID()))
|
.setUnidentifiedAccessKey(UUIDUtil.toByteString(UUID.randomUUID()))
|
||||||
|
@ -205,7 +205,7 @@ class KeysAnonymousGrpcServiceTest {
|
||||||
when(accountsManager.getByServiceIdentifierAsync(new AciServiceIdentifier(accountIdentifier)))
|
when(accountsManager.getByServiceIdentifierAsync(new AciServiceIdentifier(accountIdentifier)))
|
||||||
.thenReturn(CompletableFuture.completedFuture(Optional.of(targetAccount)));
|
.thenReturn(CompletableFuture.completedFuture(Optional.of(targetAccount)));
|
||||||
|
|
||||||
@SuppressWarnings("ResultOfMethodCallIgnored") final StatusRuntimeException exception =
|
final StatusRuntimeException exception =
|
||||||
assertThrows(StatusRuntimeException.class,
|
assertThrows(StatusRuntimeException.class,
|
||||||
() -> keysAnonymousStub.getPreKeys(GetPreKeysAnonymousRequest.newBuilder()
|
() -> keysAnonymousStub.getPreKeys(GetPreKeysAnonymousRequest.newBuilder()
|
||||||
.setUnidentifiedAccessKey(ByteString.copyFrom(unidentifiedAccessKey))
|
.setUnidentifiedAccessKey(ByteString.copyFrom(unidentifiedAccessKey))
|
||||||
|
|
|
@ -188,34 +188,37 @@ class KeysGrpcServiceTest {
|
||||||
@ParameterizedTest
|
@ParameterizedTest
|
||||||
@MethodSource
|
@MethodSource
|
||||||
void setOneTimeEcPreKeysWithError(final SetOneTimeEcPreKeysRequest request) {
|
void setOneTimeEcPreKeysWithError(final SetOneTimeEcPreKeysRequest request) {
|
||||||
@SuppressWarnings("ResultOfMethodCallIgnored") final StatusRuntimeException exception =
|
final StatusRuntimeException exception =
|
||||||
assertThrows(StatusRuntimeException.class, () -> keysStub.setOneTimeEcPreKeys(request));
|
assertThrows(StatusRuntimeException.class, () -> keysStub.setOneTimeEcPreKeys(request));
|
||||||
|
|
||||||
assertEquals(Status.INVALID_ARGUMENT.getCode(), exception.getStatus().getCode());
|
assertEquals(Status.INVALID_ARGUMENT.getCode(), exception.getStatus().getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Stream<Arguments> setOneTimeEcPreKeysWithError() {
|
private static Stream<Arguments> setOneTimeEcPreKeysWithError() {
|
||||||
|
final SetOneTimeEcPreKeysRequest prototypeRequest = SetOneTimeEcPreKeysRequest.newBuilder()
|
||||||
|
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
||||||
|
.addPreKeys(EcPreKey.newBuilder()
|
||||||
|
.setKeyId(1)
|
||||||
|
.setPublicKey(ByteString.copyFrom(Curve.generateKeyPair().getPublicKey().serialize()))
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
return Stream.of(
|
return Stream.of(
|
||||||
// Missing identity type
|
// Missing identity type
|
||||||
Arguments.of(SetOneTimeEcPreKeysRequest.newBuilder()
|
Arguments.of(SetOneTimeEcPreKeysRequest.newBuilder(prototypeRequest)
|
||||||
.addPreKeys(EcPreKey.newBuilder()
|
.clearIdentityType()
|
||||||
.setKeyId(1)
|
|
||||||
.setPublicKey(ByteString.copyFrom(Curve.generateKeyPair().getPublicKey().serialize()))
|
|
||||||
.build())
|
|
||||||
.build()),
|
.build()),
|
||||||
|
|
||||||
// Invalid public key
|
// Invalid public key
|
||||||
Arguments.of(SetOneTimeEcPreKeysRequest.newBuilder()
|
Arguments.of(SetOneTimeEcPreKeysRequest.newBuilder(prototypeRequest)
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.setPreKeys(0, EcPreKey.newBuilder(prototypeRequest.getPreKeys(0))
|
||||||
.addPreKeys(EcPreKey.newBuilder()
|
.clearPublicKey()
|
||||||
.setKeyId(1)
|
|
||||||
.setPublicKey(ByteString.empty())
|
|
||||||
.build())
|
.build())
|
||||||
.build()),
|
.build()),
|
||||||
|
|
||||||
// No keys
|
// No keys
|
||||||
Arguments.of(SetOneTimeEcPreKeysRequest.newBuilder()
|
Arguments.of(SetOneTimeEcPreKeysRequest.newBuilder(prototypeRequest)
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.clearPreKeys()
|
||||||
.build())
|
.build())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -261,7 +264,7 @@ class KeysGrpcServiceTest {
|
||||||
@ParameterizedTest
|
@ParameterizedTest
|
||||||
@MethodSource
|
@MethodSource
|
||||||
void setOneTimeKemSignedPreKeysWithError(final SetOneTimeKemSignedPreKeysRequest request) {
|
void setOneTimeKemSignedPreKeysWithError(final SetOneTimeKemSignedPreKeysRequest request) {
|
||||||
@SuppressWarnings("ResultOfMethodCallIgnored") final StatusRuntimeException exception =
|
final StatusRuntimeException exception =
|
||||||
assertThrows(StatusRuntimeException.class, () -> keysStub.setOneTimeKemSignedPreKeys(request));
|
assertThrows(StatusRuntimeException.class, () -> keysStub.setOneTimeKemSignedPreKeys(request));
|
||||||
|
|
||||||
assertEquals(Status.INVALID_ARGUMENT.getCode(), exception.getStatus().getCode());
|
assertEquals(Status.INVALID_ARGUMENT.getCode(), exception.getStatus().getCode());
|
||||||
|
@ -270,39 +273,38 @@ class KeysGrpcServiceTest {
|
||||||
private static Stream<Arguments> setOneTimeKemSignedPreKeysWithError() {
|
private static Stream<Arguments> setOneTimeKemSignedPreKeysWithError() {
|
||||||
final KEMSignedPreKey signedPreKey = KeysHelper.signedKEMPreKey(1, ACI_IDENTITY_KEY_PAIR);
|
final KEMSignedPreKey signedPreKey = KeysHelper.signedKEMPreKey(1, ACI_IDENTITY_KEY_PAIR);
|
||||||
|
|
||||||
|
final SetOneTimeKemSignedPreKeysRequest prototypeRequest = SetOneTimeKemSignedPreKeysRequest.newBuilder()
|
||||||
|
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
||||||
|
.addPreKeys(KemSignedPreKey.newBuilder()
|
||||||
|
.setKeyId(1)
|
||||||
|
.setPublicKey(ByteString.copyFrom(signedPreKey.serializedPublicKey()))
|
||||||
|
.setSignature(ByteString.copyFrom(signedPreKey.signature()))
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
return Stream.of(
|
return Stream.of(
|
||||||
// Missing identity type
|
// Missing identity type
|
||||||
Arguments.of(SetOneTimeKemSignedPreKeysRequest.newBuilder()
|
Arguments.of(SetOneTimeKemSignedPreKeysRequest.newBuilder(prototypeRequest)
|
||||||
.addPreKeys(KemSignedPreKey.newBuilder()
|
.clearIdentityType()
|
||||||
.setKeyId(1)
|
|
||||||
.setPublicKey(ByteString.copyFrom(signedPreKey.serializedPublicKey()))
|
|
||||||
.setSignature(ByteString.copyFrom(signedPreKey.signature()))
|
|
||||||
.build())
|
|
||||||
.build()),
|
.build()),
|
||||||
|
|
||||||
// Invalid public key
|
// Invalid public key
|
||||||
Arguments.of(SetOneTimeKemSignedPreKeysRequest.newBuilder()
|
Arguments.of(SetOneTimeKemSignedPreKeysRequest.newBuilder(prototypeRequest)
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.setPreKeys(0, KemSignedPreKey.newBuilder(prototypeRequest.getPreKeys(0))
|
||||||
.addPreKeys(KemSignedPreKey.newBuilder()
|
.clearPublicKey()
|
||||||
.setKeyId(1)
|
|
||||||
.setPublicKey(ByteString.empty())
|
|
||||||
.setSignature(ByteString.copyFrom(signedPreKey.signature()))
|
|
||||||
.build())
|
.build())
|
||||||
.build()),
|
.build()),
|
||||||
|
|
||||||
// Invalid signature
|
// Invalid signature
|
||||||
Arguments.of(SetOneTimeKemSignedPreKeysRequest.newBuilder()
|
Arguments.of(SetOneTimeKemSignedPreKeysRequest.newBuilder(prototypeRequest)
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.setPreKeys(0, KemSignedPreKey.newBuilder(prototypeRequest.getPreKeys(0))
|
||||||
.addPreKeys(KemSignedPreKey.newBuilder()
|
.clearSignature()
|
||||||
.setKeyId(1)
|
|
||||||
.setPublicKey(ByteString.copyFrom(signedPreKey.serializedPublicKey()))
|
|
||||||
.setSignature(ByteString.empty())
|
|
||||||
.build())
|
.build())
|
||||||
.build()),
|
.build()),
|
||||||
|
|
||||||
// No keys
|
// No keys
|
||||||
Arguments.of(SetOneTimeKemSignedPreKeysRequest.newBuilder()
|
Arguments.of(SetOneTimeKemSignedPreKeysRequest.newBuilder(prototypeRequest)
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.clearPreKeys()
|
||||||
.build())
|
.build())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -355,7 +357,7 @@ class KeysGrpcServiceTest {
|
||||||
@ParameterizedTest
|
@ParameterizedTest
|
||||||
@MethodSource
|
@MethodSource
|
||||||
void setSignedPreKeyWithError(final SetEcSignedPreKeyRequest request) {
|
void setSignedPreKeyWithError(final SetEcSignedPreKeyRequest request) {
|
||||||
@SuppressWarnings("ResultOfMethodCallIgnored") final StatusRuntimeException exception =
|
final StatusRuntimeException exception =
|
||||||
assertThrows(StatusRuntimeException.class, () -> keysStub.setEcSignedPreKey(request));
|
assertThrows(StatusRuntimeException.class, () -> keysStub.setEcSignedPreKey(request));
|
||||||
|
|
||||||
assertEquals(Status.INVALID_ARGUMENT.getCode(), exception.getStatus().getCode());
|
assertEquals(Status.INVALID_ARGUMENT.getCode(), exception.getStatus().getCode());
|
||||||
|
@ -364,39 +366,38 @@ class KeysGrpcServiceTest {
|
||||||
private static Stream<Arguments> setSignedPreKeyWithError() {
|
private static Stream<Arguments> setSignedPreKeyWithError() {
|
||||||
final ECSignedPreKey signedPreKey = KeysHelper.signedECPreKey(17, ACI_IDENTITY_KEY_PAIR);
|
final ECSignedPreKey signedPreKey = KeysHelper.signedECPreKey(17, ACI_IDENTITY_KEY_PAIR);
|
||||||
|
|
||||||
|
final SetEcSignedPreKeyRequest prototypeRequest = SetEcSignedPreKeyRequest.newBuilder()
|
||||||
|
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
||||||
|
.setSignedPreKey(EcSignedPreKey.newBuilder()
|
||||||
|
.setKeyId(signedPreKey.keyId())
|
||||||
|
.setPublicKey(ByteString.copyFrom(signedPreKey.serializedPublicKey()))
|
||||||
|
.setSignature(ByteString.copyFrom(signedPreKey.signature()))
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
return Stream.of(
|
return Stream.of(
|
||||||
// Missing identity type
|
// Missing identity type
|
||||||
Arguments.of(SetEcSignedPreKeyRequest.newBuilder()
|
Arguments.of(SetEcSignedPreKeyRequest.newBuilder(prototypeRequest)
|
||||||
.setSignedPreKey(EcSignedPreKey.newBuilder()
|
.clearIdentityType()
|
||||||
.setKeyId(signedPreKey.keyId())
|
|
||||||
.setPublicKey(ByteString.copyFrom(signedPreKey.serializedPublicKey()))
|
|
||||||
.setSignature(ByteString.copyFrom(signedPreKey.signature()))
|
|
||||||
.build())
|
|
||||||
.build()),
|
.build()),
|
||||||
|
|
||||||
// Invalid public key
|
// Invalid public key
|
||||||
Arguments.of(SetEcSignedPreKeyRequest.newBuilder()
|
Arguments.of(SetEcSignedPreKeyRequest.newBuilder(prototypeRequest)
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.setSignedPreKey(EcSignedPreKey.newBuilder(prototypeRequest.getSignedPreKey())
|
||||||
.setSignedPreKey(EcSignedPreKey.newBuilder()
|
.clearPublicKey()
|
||||||
.setKeyId(signedPreKey.keyId())
|
|
||||||
.setPublicKey(ByteString.empty())
|
|
||||||
.setSignature(ByteString.copyFrom(signedPreKey.signature()))
|
|
||||||
.build())
|
.build())
|
||||||
.build()),
|
.build()),
|
||||||
|
|
||||||
// Invalid signature
|
// Invalid signature
|
||||||
Arguments.of(SetEcSignedPreKeyRequest.newBuilder()
|
Arguments.of(SetEcSignedPreKeyRequest.newBuilder(prototypeRequest)
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.setSignedPreKey(EcSignedPreKey.newBuilder(prototypeRequest.getSignedPreKey())
|
||||||
.setSignedPreKey(EcSignedPreKey.newBuilder()
|
.clearSignature()
|
||||||
.setKeyId(signedPreKey.keyId())
|
.build())
|
||||||
.setPublicKey(ByteString.copyFrom(signedPreKey.serializedPublicKey()))
|
.build()),
|
||||||
.setSignature(ByteString.empty())
|
|
||||||
.build())
|
|
||||||
.build()),
|
|
||||||
|
|
||||||
// Missing key
|
// Missing key
|
||||||
Arguments.of(SetEcSignedPreKeyRequest.newBuilder()
|
Arguments.of(SetEcSignedPreKeyRequest.newBuilder(prototypeRequest)
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.clearSignedPreKey()
|
||||||
.build())
|
.build())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -435,7 +436,7 @@ class KeysGrpcServiceTest {
|
||||||
@ParameterizedTest
|
@ParameterizedTest
|
||||||
@MethodSource
|
@MethodSource
|
||||||
void setLastResortPreKeyWithError(final SetKemLastResortPreKeyRequest request) {
|
void setLastResortPreKeyWithError(final SetKemLastResortPreKeyRequest request) {
|
||||||
@SuppressWarnings("ResultOfMethodCallIgnored") final StatusRuntimeException exception =
|
final StatusRuntimeException exception =
|
||||||
assertThrows(StatusRuntimeException.class, () -> keysStub.setKemLastResortPreKey(request));
|
assertThrows(StatusRuntimeException.class, () -> keysStub.setKemLastResortPreKey(request));
|
||||||
|
|
||||||
assertEquals(Status.INVALID_ARGUMENT.getCode(), exception.getStatus().getCode());
|
assertEquals(Status.INVALID_ARGUMENT.getCode(), exception.getStatus().getCode());
|
||||||
|
@ -444,39 +445,38 @@ class KeysGrpcServiceTest {
|
||||||
private static Stream<Arguments> setLastResortPreKeyWithError() {
|
private static Stream<Arguments> setLastResortPreKeyWithError() {
|
||||||
final KEMSignedPreKey lastResortPreKey = KeysHelper.signedKEMPreKey(17, ACI_IDENTITY_KEY_PAIR);
|
final KEMSignedPreKey lastResortPreKey = KeysHelper.signedKEMPreKey(17, ACI_IDENTITY_KEY_PAIR);
|
||||||
|
|
||||||
|
final SetKemLastResortPreKeyRequest prototypeRequest = SetKemLastResortPreKeyRequest.newBuilder()
|
||||||
|
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
||||||
|
.setSignedPreKey(KemSignedPreKey.newBuilder()
|
||||||
|
.setKeyId(lastResortPreKey.keyId())
|
||||||
|
.setPublicKey(ByteString.copyFrom(lastResortPreKey.serializedPublicKey()))
|
||||||
|
.setSignature(ByteString.copyFrom(lastResortPreKey.signature()))
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
return Stream.of(
|
return Stream.of(
|
||||||
// No identity type
|
// No identity type
|
||||||
Arguments.of(SetKemLastResortPreKeyRequest.newBuilder()
|
Arguments.of(SetKemLastResortPreKeyRequest.newBuilder(prototypeRequest)
|
||||||
.setSignedPreKey(KemSignedPreKey.newBuilder()
|
.clearIdentityType()
|
||||||
.setKeyId(lastResortPreKey.keyId())
|
|
||||||
.setPublicKey(ByteString.copyFrom(lastResortPreKey.serializedPublicKey()))
|
|
||||||
.setSignature(ByteString.copyFrom(lastResortPreKey.signature()))
|
|
||||||
.build())
|
|
||||||
.build()),
|
.build()),
|
||||||
|
|
||||||
// Bad public key
|
// Bad public key
|
||||||
Arguments.of(SetKemLastResortPreKeyRequest.newBuilder()
|
Arguments.of(SetKemLastResortPreKeyRequest.newBuilder(prototypeRequest)
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.setSignedPreKey(KemSignedPreKey.newBuilder(prototypeRequest.getSignedPreKey())
|
||||||
.setSignedPreKey(KemSignedPreKey.newBuilder()
|
.clearPublicKey()
|
||||||
.setKeyId(lastResortPreKey.keyId())
|
|
||||||
.setPublicKey(ByteString.empty())
|
|
||||||
.setSignature(ByteString.copyFrom(lastResortPreKey.signature()))
|
|
||||||
.build())
|
.build())
|
||||||
.build()),
|
.build()),
|
||||||
|
|
||||||
// Bad signature
|
// Bad signature
|
||||||
Arguments.of(SetKemLastResortPreKeyRequest.newBuilder()
|
Arguments.of(SetKemLastResortPreKeyRequest.newBuilder(prototypeRequest)
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.setSignedPreKey(KemSignedPreKey.newBuilder(prototypeRequest.getSignedPreKey())
|
||||||
.setSignedPreKey(KemSignedPreKey.newBuilder()
|
.clearSignature()
|
||||||
.setKeyId(lastResortPreKey.keyId())
|
|
||||||
.setPublicKey(ByteString.copyFrom(lastResortPreKey.serializedPublicKey()))
|
|
||||||
.setSignature(ByteString.empty())
|
|
||||||
.build())
|
.build())
|
||||||
.build()),
|
.build()),
|
||||||
|
|
||||||
// Missing key
|
// Missing key
|
||||||
Arguments.of(SetKemLastResortPreKeyRequest.newBuilder()
|
Arguments.of(SetKemLastResortPreKeyRequest.newBuilder(prototypeRequest)
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.clearSignedPreKey()
|
||||||
.build())
|
.build())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -605,7 +605,7 @@ class KeysGrpcServiceTest {
|
||||||
when(accountsManager.getByServiceIdentifierAsync(any()))
|
when(accountsManager.getByServiceIdentifierAsync(any()))
|
||||||
.thenReturn(CompletableFuture.completedFuture(Optional.empty()));
|
.thenReturn(CompletableFuture.completedFuture(Optional.empty()));
|
||||||
|
|
||||||
@SuppressWarnings("ResultOfMethodCallIgnored") final StatusRuntimeException exception =
|
final StatusRuntimeException exception =
|
||||||
assertThrows(StatusRuntimeException.class, () -> keysStub.getPreKeys(GetPreKeysRequest.newBuilder()
|
assertThrows(StatusRuntimeException.class, () -> keysStub.getPreKeys(GetPreKeysRequest.newBuilder()
|
||||||
.setTargetIdentifier(ServiceIdentifier.newBuilder()
|
.setTargetIdentifier(ServiceIdentifier.newBuilder()
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
||||||
|
@ -630,7 +630,7 @@ class KeysGrpcServiceTest {
|
||||||
when(accountsManager.getByServiceIdentifierAsync(new AciServiceIdentifier(accountIdentifier)))
|
when(accountsManager.getByServiceIdentifierAsync(new AciServiceIdentifier(accountIdentifier)))
|
||||||
.thenReturn(CompletableFuture.completedFuture(Optional.of(targetAccount)));
|
.thenReturn(CompletableFuture.completedFuture(Optional.of(targetAccount)));
|
||||||
|
|
||||||
@SuppressWarnings("ResultOfMethodCallIgnored") final StatusRuntimeException exception =
|
final StatusRuntimeException exception =
|
||||||
assertThrows(StatusRuntimeException.class, () -> keysStub.getPreKeys(GetPreKeysRequest.newBuilder()
|
assertThrows(StatusRuntimeException.class, () -> keysStub.getPreKeys(GetPreKeysRequest.newBuilder()
|
||||||
.setTargetIdentifier(ServiceIdentifier.newBuilder()
|
.setTargetIdentifier(ServiceIdentifier.newBuilder()
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
||||||
|
@ -658,7 +658,7 @@ class KeysGrpcServiceTest {
|
||||||
when(preKeysRateLimiter.validateReactive(anyString()))
|
when(preKeysRateLimiter.validateReactive(anyString()))
|
||||||
.thenReturn(Mono.error(new RateLimitExceededException(retryAfterDuration, false)));
|
.thenReturn(Mono.error(new RateLimitExceededException(retryAfterDuration, false)));
|
||||||
|
|
||||||
@SuppressWarnings("ResultOfMethodCallIgnored") final StatusRuntimeException exception =
|
final StatusRuntimeException exception =
|
||||||
assertThrows(StatusRuntimeException.class, () -> keysStub.getPreKeys(GetPreKeysRequest.newBuilder()
|
assertThrows(StatusRuntimeException.class, () -> keysStub.getPreKeys(GetPreKeysRequest.newBuilder()
|
||||||
.setTargetIdentifier(ServiceIdentifier.newBuilder()
|
.setTargetIdentifier(ServiceIdentifier.newBuilder()
|
||||||
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
.setIdentityType(org.signal.chat.common.IdentityType.IDENTITY_TYPE_ACI)
|
||||||
|
|
Loading…
Reference in New Issue