use of com.google.protobuf.UInt32Value in project core-java by SpineEventEngine.
the class TypeConverterShould method map_uint32_to_int.
@Test
public void map_uint32_to_int() {
final int value = 42;
final UInt32Value wrapped = UInt32Value.newBuilder().setValue(value).build();
final Any packed = AnyPacker.pack(wrapped);
final int mapped = TypeConverter.toObject(packed, Integer.class);
assertEquals(value, mapped);
}
use of com.google.protobuf.UInt32Value in project core-java by SpineEventEngine.
the class AggregateMessageDispatcherShould method dispatch_command.
@Test
public void dispatch_command() {
final TestActorRequestFactory factory = TestActorRequestFactory.newInstance(getClass());
final int messageValue = 2017_07_28;
final UInt32Value message = UInt32Value.newBuilder().setValue(messageValue).build();
final CommandEnvelope commandEnvelope = CommandEnvelope.of(factory.createCommand(message));
final List<? extends Message> eventMessages = dispatchCommand(aggregate, commandEnvelope);
assertTrue(aggregate.getState().getValue().contains(String.valueOf(messageValue)));
assertEquals(1, eventMessages.size());
assertTrue(eventMessages.get(0) instanceof StringValue);
}
Aggregations