use of com.google.protobuf.FloatValue in project core-java by SpineEventEngine.
the class FloatFieldValidatorShould method wrap_to_any.
@Test
public void wrap_to_any() {
final Any any = validator.wrap(VALUE);
final FloatValue msg = AnyPacker.unpack(any);
assertEquals(VALUE, (Float) msg.getValue());
}
use of com.google.protobuf.FloatValue in project core-java by SpineEventEngine.
the class AggregateMessageDispatcherShould method dispatch_event.
@Test
public void dispatch_event() {
final TestEventFactory factory = TestEventFactory.newInstance(getClass());
final float messageValue = 2017.0729f;
final FloatValue message = FloatValue.newBuilder().setValue(messageValue).build();
final EventEnvelope eventEnvelope = EventEnvelope.of(factory.createEvent(message));
final List<? extends Message> eventMessages = dispatchEvent(aggregate, eventEnvelope);
assertTrue(aggregate.getState().getValue().contains(String.valueOf(messageValue)));
assertEquals(1, eventMessages.size());
assertTrue(eventMessages.get(0) instanceof StringValue);
}
Aggregations