From 4eb29a8ebdc506ddaaaf61eb8f159791fb34c3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Chicchiricc=C3=B2?= Date: Mon, 27 Nov 2023 14:36:26 +0100 Subject: [PATCH] Allowing more time to GitHub runners to refresh WA during tests (#558) --- .../java/org/apache/syncope/fit/AbstractITCase.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fit/wa-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java b/fit/wa-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java index 8d12f1d54c..016026baf3 100644 --- a/fit/wa-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java +++ b/fit/wa-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java @@ -116,39 +116,39 @@ public static void restSetup() { public static void waitForWARefresh() { SAML2IdPEntityService samlIdPEntityService = ADMIN_CLIENT.getService(SAML2IdPEntityService.class); - await().atMost(60, TimeUnit.SECONDS).pollInterval(20, TimeUnit.SECONDS).until(() -> { + await().atMost(120, TimeUnit.SECONDS).pollInterval(20, TimeUnit.SECONDS).until(() -> { boolean refreshed = false; try { String metadata = WebClient.create( WA_ADDRESS + "/idp/metadata").get().readEntity(String.class); if (metadata.contains("localhost:8080")) { - WA_CONFIG_SERVICE.pushToWA(WAConfigService.PushSubject.conf, List.of()); throw new IllegalStateException(); } metadata = WebClient.create( WA_ADDRESS + "/oidc/" + OidcConstants.WELL_KNOWN_OPENID_CONFIGURATION_URL). get().readEntity(String.class); if (metadata.contains("localhost:8080")) { - WA_CONFIG_SERVICE.pushToWA(WAConfigService.PushSubject.conf, List.of()); throw new IllegalStateException(); } metadata = WebClient.create( WA_ADDRESS + "/actuator/registeredServices", ANONYMOUS_USER, ANONYMOUS_KEY, null). get().readEntity(String.class); if (metadata.contains("localhost:8080/syncope-wa")) { - WA_CONFIG_SERVICE.pushToWA(WAConfigService.PushSubject.conf, List.of()); throw new IllegalStateException(); } metadata = WebClient.create( WA_ADDRESS + "/actuator/authenticationHandlers", ANONYMOUS_USER, ANONYMOUS_KEY, null). get().readEntity(String.class); if (!metadata.contains("DefaultLDAPAuthModule")) { - WA_CONFIG_SERVICE.pushToWA(WAConfigService.PushSubject.conf, List.of()); throw new IllegalStateException(); } samlIdPEntityService.get(SAML2IdPEntityService.DEFAULT_OWNER); refreshed = true; + } catch (IllegalStateException e) { + WebClient.create( + WA_ADDRESS + "/actuator/refresh", ANONYMOUS_USER, ANONYMOUS_KEY, null). + post(null); } catch (Exception e) { // ignore }