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());
}
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 TypeUrlShould method obtain_type_of_command.
@Test
public void obtain_type_of_command() {
final ActorRequestFactory factory = TestActorRequestFactory.newInstance(TypeUrlShould.class);
final StringValue message = Wrapper.forString(newUuid());
final Command command = factory.command().create(message);
final TypeUrl typeUrl = TypeUrl.ofCommand(command);
assertIsStringValueUrl(typeUrl);
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class ProjectionRepositoryShould method throw_exception_if_dispatch_unknown_event.
@Test(expected = RuntimeException.class)
public void throw_exception_if_dispatch_unknown_event() {
final StringValue unknownEventMessage = StringValue.getDefaultInstance();
final Event event = EventTests.createContextlessEvent(unknownEventMessage);
repository().dispatch(event);
}
use of com.google.protobuf.StringValue in project core-java by SpineEventEngine.
the class ProcessManagerRepositoryShould method throw_exception_if_dispatch_unknown_event.
@Test(expected = IllegalArgumentException.class)
public void throw_exception_if_dispatch_unknown_event() {
final StringValue unknownEventMessage = StringValue.getDefaultInstance();
final Event event = createEvent(unknownEventMessage);
repository.dispatch(event);
}
Aggregations