Search in sources :

Example 1 with Int64Value

use of com.google.protobuf.Int64Value in project core-java by SpineEventEngine.

the class LongFieldValidatorShould method wrap_to_any.

@Test
public void wrap_to_any() {
    final Any any = validator.wrap(VALUE);
    final Int64Value msg = AnyPacker.unpack(any);
    assertEquals(VALUE, (Long) msg.getValue());
}
Also used : Int64Value(com.google.protobuf.Int64Value) Any(com.google.protobuf.Any) Test(org.junit.Test)

Example 2 with Int64Value

use of com.google.protobuf.Int64Value in project core-java by SpineEventEngine.

the class IdentifiersShould method convert_to_string_long_id_wrapped_into_message.

@Test
public void convert_to_string_long_id_wrapped_into_message() {
    final Long value = 100500L;
    final Int64Value id = forLong(value);
    final String expected = value.toString();
    final String actual = idToString(id);
    assertEquals(expected, actual);
}
Also used : Int64Value(com.google.protobuf.Int64Value) Wrapper.forLong(io.spine.protobuf.Wrapper.forLong) Identifiers.idToString(io.spine.base.Identifiers.idToString) Wrapper.forString(io.spine.protobuf.Wrapper.forString) Test(org.junit.Test)

Aggregations

Int64Value (com.google.protobuf.Int64Value)2 Test (org.junit.Test)2 Any (com.google.protobuf.Any)1 Identifiers.idToString (io.spine.base.Identifiers.idToString)1 Wrapper.forLong (io.spine.protobuf.Wrapper.forLong)1 Wrapper.forString (io.spine.protobuf.Wrapper.forString)1