use of io.spine.core.Command in project core-java by SpineEventEngine.
the class SingleTenantCommandBusShould method reject_multitenant_command_in_single_tenant_context.
@Test
public void reject_multitenant_command_in_single_tenant_context() {
// Create a multi-tenant command.
final Command cmd = createProject();
commandBus.post(cmd, observer);
checkCommandError(observer.firstResponse(), TENANT_INAPPLICABLE, InvalidCommandException.class, cmd);
}
use of io.spine.core.Command in project core-java by SpineEventEngine.
the class SingleTenantCommandBusShould method reject_invalid_command.
@Test
public void reject_invalid_command() {
final Command cmd = newCommandWithoutContext();
commandBus.post(cmd, observer);
checkCommandError(observer.firstResponse(), INVALID_COMMAND, CommandValidationError.getDescriptor().getFullName(), cmd);
}
use of io.spine.core.Command in project core-java by SpineEventEngine.
the class StorageShould method store_and_read_command.
// We get right after we store.
@SuppressWarnings("OptionalGetWithoutIsPresent")
@Test
public void store_and_read_command() {
final Command command = Given.ACommand.createProject();
final CommandId commandId = command.getId();
repository.store(command);
final CommandRecord record = read(commandId).get();
checkRecord(record, command, RECEIVED);
}
use of io.spine.core.Command in project core-java by SpineEventEngine.
the class StorageShould method store_command_with_status.
// We get right after we store.
@SuppressWarnings("OptionalGetWithoutIsPresent")
@Test
public void store_command_with_status() {
final Command command = Given.ACommand.createProject();
final CommandId commandId = command.getId();
final CommandStatus status = SCHEDULED;
repository.store(command, status);
final CommandRecord record = read(commandId).get();
checkRecord(record, command, status);
}
use of io.spine.core.Command in project core-java by SpineEventEngine.
the class CommandEnvelopeShould method obtain_actor_context.
@Test
public void obtain_actor_context() {
final Command command = outerObject();
final CommandEnvelope envelope = toEnvelope(command);
assertEquals(command.getContext().getActorContext(), envelope.getActorContext());
}
Aggregations