@JsonProperty("status")
    public Status status() {
        if (indices.isEmpty() || indices.stream().allMatch(i -> i.status() == Status.NOT_STARTED)) {
            return Status.NOT_STARTED;
        } else if (indices.stream().allMatch(RemoteReindexIndex::isCompleted)) {
            // all are now completed, either finished or errored
            if (indices.stream().anyMatch(i -> i.status() == Status.ERROR)) {
                return Status.ERROR;
            } else {
                return Status.FINISHED;
            }
        } else {
            return Status.RUNNING;
        }
    }
@Test
    void testStatusNotStarted() {
        final RemoteReindexMigration migration = withIndices(
                index("one", RemoteReindexingMigrationAdapter.Status.NOT_STARTED),
                index("two", RemoteReindexingMigrationAdapter.Status.NOT_STARTED)
        );
        Assertions.assertThat(migration.status()).isEqualTo(RemoteReindexingMigrationAdapter.Status.NOT_STARTED);
    }