use of io.spine.server.commandbus.CommandRecord 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.server.commandbus.CommandRecord in project core-java by SpineEventEngine.
the class CEntity method setToRejected.
void setToRejected(Rejection rejection) {
final CommandRecord.Builder builder = getState().toBuilder();
builder.getStatusBuilder().setCode(REJECTED).setRejection(rejection);
final CommandRecord record = builder.build();
updateState(record);
}
use of io.spine.server.commandbus.CommandRecord in project core-java by SpineEventEngine.
the class CEntity method setError.
private void setError(CommandId id, Command command, Error error) {
final CommandRecord.Builder builder = Records.newRecordBuilder(command, ERROR, id);
builder.getStatusBuilder().setError(error);
final CommandRecord record = builder.build();
updateState(record);
}
Aggregations