use of io.spine.server.commandbus.CommandRecord in project core-java by SpineEventEngine.
the class CEntity method setOkStatus.
void setOkStatus() {
final CommandRecord.Builder builder = getState().toBuilder();
builder.getStatusBuilder().setCode(OK);
final CommandRecord record = builder.build();
updateState(record);
}
use of io.spine.server.commandbus.CommandRecord in project core-java by SpineEventEngine.
the class CEntity method setCommandAndStatus.
private void setCommandAndStatus(Command command, CommandStatus status) {
final CommandRecord record = Records.newRecordBuilder(command, status, null).build();
updateState(record);
}
use of io.spine.server.commandbus.CommandRecord in project core-java by SpineEventEngine.
the class RecordsShould method convert_cmd_to_record.
/*
* Conversion tests.
*******************/
@Test
public void convert_cmd_to_record() {
final Command command = Given.ACommand.createProject();
final CommandStatus status = CommandStatus.RECEIVED;
final CommandRecord record = newRecordBuilder(command, status, null).build();
checkRecord(record, command, status);
}
use of io.spine.server.commandbus.CommandRecord in project core-java by SpineEventEngine.
the class StorageShould method set_error_command_status.
// We get right after we update status.
@SuppressWarnings("OptionalGetWithoutIsPresent")
@Test
public void set_error_command_status() {
givenNewRecord();
final Error error = newError();
repository.updateStatus(id, error);
final CommandRecord actual = read(id).get();
assertEquals(ERROR, actual.getStatus().getCode());
assertEquals(error, actual.getStatus().getError());
}
use of io.spine.server.commandbus.CommandRecord in project core-java by SpineEventEngine.
the class StorageShould method givenNewRecord.
private void givenNewRecord() {
final CommandRecord record = newStorageRecord();
id = record.getCommandId();
repository.store(record.getCommand());
}
Aggregations