@Test void neitherExitNorFailure() { database.setStatus(Status.CREATE_IN_PROGRESS); AttemptResult<Object> result = underTest.resolveResultByCriteria(DatabaseOperation.CREATION, database, cluster); assertThat(result.getState()).isEqualTo(AttemptState.CONTINUE); assertThat(result.getResult()).isNull(); }
@NotNull AttemptResult<Object> resolveResultByCriteria(DatabaseOperation databaseOperation, DatabaseServerV4Response rdsStatus, Cluster cluster) { checkArgument(databaseOperation != null, "DatabaseOperation should not be null"); checkArgument(rdsStatus != null, "DatabaseServerV4Response should not be null"); AttemptResult<Object> result; if (databaseOperation.getExitCriteria().apply(rdsStatus.getStatus())) { result = AttemptResults.finishWith(rdsStatus); } else { if (databaseOperation.getFailureCriteria().apply(rdsStatus.getStatus())) { result = rdsStatus.getStatusReason() != null && rdsStatus.getStatusReason().contains("does not exist") ? AttemptResults.finishWith(null) : AttemptResults.breakFor(getDatabaseOperationFailedResultMessage(cluster, rdsStatus)); } else { result = AttemptResults.justContinue(); } } return result; }
DatabaseCriteriaResolver { @NotNull AttemptResult<Object> resolveResultByCriteria(DatabaseOperation databaseOperation, DatabaseServerV4Response rdsStatus, Cluster cluster) { checkArgument(databaseOperation != null, "DatabaseOperation should not be null"); checkArgument(rdsStatus != null, "DatabaseServerV4Response should not be null"); AttemptResult<Object> result; if (databaseOperation.getExitCriteria().apply(rdsStatus.getStatus())) { result = AttemptResults.finishWith(rdsStatus); } else { if (databaseOperation.getFailureCriteria().apply(rdsStatus.getStatus())) { result = rdsStatus.getStatusReason() != null && rdsStatus.getStatusReason().contains("does not exist") ? AttemptResults.finishWith(null) : AttemptResults.breakFor(getDatabaseOperationFailedResultMessage(cluster, rdsStatus)); } else { result = AttemptResults.justContinue(); } } return result; } }
DatabaseCriteriaResolver { @NotNull AttemptResult<Object> resolveResultByCriteria(DatabaseOperation databaseOperation, DatabaseServerV4Response rdsStatus, Cluster cluster) { checkArgument(databaseOperation != null, "DatabaseOperation should not be null"); checkArgument(rdsStatus != null, "DatabaseServerV4Response should not be null"); AttemptResult<Object> result; if (databaseOperation.getExitCriteria().apply(rdsStatus.getStatus())) { result = AttemptResults.finishWith(rdsStatus); } else { if (databaseOperation.getFailureCriteria().apply(rdsStatus.getStatus())) { result = rdsStatus.getStatusReason() != null && rdsStatus.getStatusReason().contains("does not exist") ? AttemptResults.finishWith(null) : AttemptResults.breakFor(getDatabaseOperationFailedResultMessage(cluster, rdsStatus)); } else { result = AttemptResults.justContinue(); } } return result; }  }
DatabaseCriteriaResolver { @NotNull AttemptResult<Object> resolveResultByCriteria(DatabaseOperation databaseOperation, DatabaseServerV4Response rdsStatus, Cluster cluster) { checkArgument(databaseOperation != null, "DatabaseOperation should not be null"); checkArgument(rdsStatus != null, "DatabaseServerV4Response should not be null"); AttemptResult<Object> result; if (databaseOperation.getExitCriteria().apply(rdsStatus.getStatus())) { result = AttemptResults.finishWith(rdsStatus); } else { if (databaseOperation.getFailureCriteria().apply(rdsStatus.getStatus())) { result = rdsStatus.getStatusReason() != null && rdsStatus.getStatusReason().contains("does not exist") ? AttemptResults.finishWith(null) : AttemptResults.breakFor(getDatabaseOperationFailedResultMessage(cluster, rdsStatus)); } else { result = AttemptResults.justContinue(); } } return result; }   }
DatabaseCriteriaResolver { @NotNull AttemptResult<Object> resolveResultByCriteria(DatabaseOperation databaseOperation, DatabaseServerV4Response rdsStatus, Cluster cluster) { checkArgument(databaseOperation != null, "DatabaseOperation should not be null"); checkArgument(rdsStatus != null, "DatabaseServerV4Response should not be null"); AttemptResult<Object> result; if (databaseOperation.getExitCriteria().apply(rdsStatus.getStatus())) { result = AttemptResults.finishWith(rdsStatus); } else { if (databaseOperation.getFailureCriteria().apply(rdsStatus.getStatus())) { result = rdsStatus.getStatusReason() != null && rdsStatus.getStatusReason().contains("does not exist") ? AttemptResults.finishWith(null) : AttemptResults.breakFor(getDatabaseOperationFailedResultMessage(cluster, rdsStatus)); } else { result = AttemptResults.justContinue(); } } return result; }    }