use of io.spine.core.CommandStatus 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.core.CommandStatus in project core-java by SpineEventEngine.
the class StorageShould method convert_cmd_to_record.
/*
* Conversion tests.
*******************/
@Test
public void convert_cmd_to_record() {
final Command command = Given.ACommand.createProject();
final CommandStatus status = RECEIVED;
final CommandRecord record = newRecordBuilder(command, status, null).build();
checkRecord(record, command, status);
}
use of io.spine.core.CommandStatus in project core-java by SpineEventEngine.
the class StorageShould method load_commands_by_status.
@Test
public void load_commands_by_status() {
final List<Command> commands = ImmutableList.of(Given.ACommand.createProject(), Given.ACommand.addTask(), Given.ACommand.startProject());
final CommandStatus status = SCHEDULED;
store(commands, status);
// store an extra command with another status
repository.store(Given.ACommand.createProject(), ERROR);
final Iterator<CommandRecord> iterator = repository.iterator(status);
final List<Command> actualCommands = newArrayList(toCommandIterator(iterator));
assertEquals(commands.size(), actualCommands.size());
for (Command cmd : actualCommands) {
assertTrue(commands.contains(cmd));
}
}
use of io.spine.core.CommandStatus 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);
}
Aggregations