diff --git a/acme4j-it/src/test/java/org/shredzone/acme4j/it/OrderIT.java b/acme4j-it/src/test/java/org/shredzone/acme4j/it/OrderIT.java index f1b93a4c..dd897cb8 100644 --- a/acme4j-it/src/test/java/org/shredzone/acme4j/it/OrderIT.java +++ b/acme4j-it/src/test/java/org/shredzone/acme4j/it/OrderIT.java @@ -157,7 +157,7 @@ public class OrderIT extends PebbleITBase { .pollInterval(1, SECONDS) .timeout(30, SECONDS) .conditionEvaluationListener(cond -> updateAuth(auth)) - .until(auth::getStatus, not(Status.PENDING)); + .until(auth::getStatus, not(isOneOf(Status.PENDING, Status.PROCESSING))); if (auth.getStatus() != Status.VALID) { fail("Authorization failed"); @@ -171,6 +171,13 @@ public class OrderIT extends PebbleITBase { order.execute(encodedCsr); + await() + .pollInterval(1, SECONDS) + .timeout(30, SECONDS) + .conditionEvaluationListener(cond -> updateOrder(order)) + .until(order::getStatus, not(isOneOf(Status.PENDING, Status.PROCESSING))); + + Certificate certificate = order.getCertificate(); X509Certificate cert = certificate.getCertificate(); assertThat(cert, not(nullValue())); @@ -193,6 +200,20 @@ public class OrderIT extends PebbleITBase { } } + /** + * Safely updates the order, catching checked exceptions. + * + * @param order + * {@link Order} to update + */ + private void updateOrder(Order order) { + try { + order.update(); + } catch (AcmeException ex) { + throw new AcmeLazyLoadingException(order, ex); + } + } + @FunctionalInterface private static interface Validator { Challenge prepare(Authorization auth) throws Exception;