use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class AnyPackerShould method unpack_google_message_from_Any.
@Test
public void unpack_google_message_from_Any() {
final Any any = Any.pack(googleMsg);
final StringValue actual = AnyPacker.unpack(any);
assertEquals(googleMsg, actual);
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class WrappersShould method format.
@Test
public void format() {
final StringValue str = Wrappers.format("%d %d %d", 1, 2, 3);
assertEquals(str.getValue(), "1 2 3");
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class EventPlayingEntityShould method return_builder_reflecting_current_state.
@Test
public void return_builder_reflecting_current_state() {
final EventPlayingEntity entity = newEntity();
final Message originalState = entity.builderFromState().build();
final StringValue newState = newUuidValue();
assertNotEquals(originalState, newState);
TestTransaction.injectState(entity, newState, Version.getDefaultInstance());
final Message modifiedState = entity.builderFromState().build();
assertEquals(newState, modifiedState);
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class CommandTestShould method stores_command_after_creation.
// This test verifies that Optionals
@SuppressWarnings("OptionalGetWithoutIsPresent")
// are initialized.
@Test
public void stores_command_after_creation() {
final StringValue commandMessage = newUuidValue();
final Command command = commandTest.createCommand(commandMessage);
assertEquals(commandMessage, commandTest.commandMessage().get());
assertEquals(command.getContext(), commandTest.commandContext().get());
assertEquals(command, commandTest.command().get());
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class CommandTestShould method create_command_with_custom_Timestamp.
@Test
public void create_command_with_custom_Timestamp() {
final StringValue commandMessage = newUuidValue();
final Timestamp timestamp = TimeTests.Past.minutesAgo(5);
final Command command = commandTest.createCommand(commandMessage, timestamp);
assertEquals(timestamp, command.getContext().getActorContext().getTimestamp());
}
Aggregations