use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class EventsShould method obtain_type_name_of_event.
@Test
public void obtain_type_name_of_event() {
final CommandEnvelope command = requestFactory.generateEnvelope();
final StringValue producerId = toMessage(getClass().getSimpleName());
final EventFactory ef = EventFactory.on(command, Identifier.pack(producerId));
final Event event = ef.createEvent(Time.getCurrentTime(), Tests.<Version>nullRef());
final TypeName typeName = EventEnvelope.of(event).getTypeName();
assertNotNull(typeName);
assertEquals(Timestamp.class.getSimpleName(), typeName.getSimpleName());
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class EventsShould method obtain_root_command_id.
@Test
public void obtain_root_command_id() {
final CommandEnvelope command = requestFactory.generateEnvelope();
final StringValue producerId = toMessage(getClass().getSimpleName());
final EventFactory ef = EventFactory.on(command, Identifier.pack(producerId));
final Event event = ef.createEvent(Time.getCurrentTime(), Tests.<Version>nullRef());
assertEquals(command.getId(), Events.getRootCommandId(event));
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class PairShould method allow_optional_B_absent.
@Test
public void allow_optional_B_absent() {
StringValue a = TestValues.newUuidValue();
Optional<BoolValue> b = Optional.absent();
Pair<StringValue, Optional<BoolValue>> pair = Pair.withNullable(a, null);
assertEquals(a, pair.getA());
assertEquals(b, pair.getB());
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class PairShould method return_values.
@Test
public void return_values() {
StringValue a = TestValues.newUuidValue();
BoolValue b = BoolValue.of(true);
Pair<StringValue, BoolValue> pair = Pair.of(a, b);
assertEquals(a, pair.getA());
assertEquals(b, pair.getB());
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class PairShould method support_equality.
@Test
public void support_equality() {
final StringValue v1 = TestValues.newUuidValue();
final StringValue v2 = TestValues.newUuidValue();
final Pair<StringValue, StringValue> p1 = Pair.of(v1, v2);
final Pair<StringValue, StringValue> p1a = Pair.of(v1, v2);
final Pair<StringValue, StringValue> p2 = Pair.of(v2, v1);
new EqualsTester().addEqualityGroup(p1, p1a).addEqualityGroup(p2).testEquals();
}
Aggregations