Search in sources :

Example 1 with AddressProto

use of org.whispersystems.signalservice.internal.serialize.protos.AddressProto in project Signal-Android by signalapp.

the class SignalServiceAddressProtobufSerializerTest method serialize_and_deserialize_both_address.

@Test
public void serialize_and_deserialize_both_address() {
    SignalServiceAddress address = new SignalServiceAddress(ServiceId.from(UUID.randomUUID()), Optional.of("+15552345678"));
    AddressProto addressProto = org.whispersystems.signalservice.internal.serialize.SignalServiceAddressProtobufSerializer.toProtobuf(address);
    SignalServiceAddress deserialized = org.whispersystems.signalservice.internal.serialize.SignalServiceAddressProtobufSerializer.fromProtobuf(addressProto);
    assertEquals(address, deserialized);
}
Also used : AddressProto(org.whispersystems.signalservice.internal.serialize.protos.AddressProto) SignalServiceAddress(org.whispersystems.signalservice.api.push.SignalServiceAddress) Test(org.junit.Test)

Example 2 with AddressProto

use of org.whispersystems.signalservice.internal.serialize.protos.AddressProto in project Signal-Android by WhisperSystems.

the class SignalServiceAddressProtobufSerializerTest method serialize_and_deserialize_both_address.

@Test
public void serialize_and_deserialize_both_address() {
    SignalServiceAddress address = new SignalServiceAddress(ServiceId.from(UUID.randomUUID()), Optional.of("+15552345678"));
    AddressProto addressProto = org.whispersystems.signalservice.internal.serialize.SignalServiceAddressProtobufSerializer.toProtobuf(address);
    SignalServiceAddress deserialized = org.whispersystems.signalservice.internal.serialize.SignalServiceAddressProtobufSerializer.fromProtobuf(addressProto);
    assertEquals(address, deserialized);
}
Also used : AddressProto(org.whispersystems.signalservice.internal.serialize.protos.AddressProto) SignalServiceAddress(org.whispersystems.signalservice.api.push.SignalServiceAddress) Test(org.junit.Test)

Example 3 with AddressProto

use of org.whispersystems.signalservice.internal.serialize.protos.AddressProto in project Signal-Android by WhisperSystems.

the class SignalServiceAddressProtobufSerializerTest method serialize_and_deserialize_uuid_address.

@Test
public void serialize_and_deserialize_uuid_address() {
    SignalServiceAddress address = new SignalServiceAddress(ServiceId.from(UUID.randomUUID()), Optional.absent());
    AddressProto addressProto = org.whispersystems.signalservice.internal.serialize.SignalServiceAddressProtobufSerializer.toProtobuf(address);
    SignalServiceAddress deserialized = org.whispersystems.signalservice.internal.serialize.SignalServiceAddressProtobufSerializer.fromProtobuf(addressProto);
    assertEquals(address, deserialized);
}
Also used : AddressProto(org.whispersystems.signalservice.internal.serialize.protos.AddressProto) SignalServiceAddress(org.whispersystems.signalservice.api.push.SignalServiceAddress) Test(org.junit.Test)

Example 4 with AddressProto

use of org.whispersystems.signalservice.internal.serialize.protos.AddressProto in project Signal-Android by signalapp.

the class SignalServiceAddressProtobufSerializerTest method serialize_and_deserialize_uuid_address.

@Test
public void serialize_and_deserialize_uuid_address() {
    SignalServiceAddress address = new SignalServiceAddress(ServiceId.from(UUID.randomUUID()), Optional.absent());
    AddressProto addressProto = org.whispersystems.signalservice.internal.serialize.SignalServiceAddressProtobufSerializer.toProtobuf(address);
    SignalServiceAddress deserialized = org.whispersystems.signalservice.internal.serialize.SignalServiceAddressProtobufSerializer.fromProtobuf(addressProto);
    assertEquals(address, deserialized);
}
Also used : AddressProto(org.whispersystems.signalservice.internal.serialize.protos.AddressProto) SignalServiceAddress(org.whispersystems.signalservice.api.push.SignalServiceAddress) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 SignalServiceAddress (org.whispersystems.signalservice.api.push.SignalServiceAddress)4 AddressProto (org.whispersystems.signalservice.internal.serialize.protos.AddressProto)4