apupier commented on code in PR #26184:
URL: https://github.com/apache/camel/pull/26184#discussion_r3956528448
##########
components/camel-oauth/src/test/java/org/apache/camel/test/oauth/SSLCertTrustTest.java:
##########
@@ -79,12 +83,25 @@ void testCheckKeycloakCertificateTrust() {
@Test
void testUntrustedCertificate() {
String url = "https://untrusted-root.badssl.com"; // Example of an
untrusted cert
- Assertions.assertThrows(SSLHandshakeException.class, () ->
connectToUrl(url), "Certificate should not be trusted");
+ try {
+ connectToUrl(url);
+ Assertions.fail("Certificate should not be trusted");
+ } catch (SSLHandshakeException e) {
+ // Expected: untrusted certificate
+ } catch (ConnectException e) {
+ // External site unreachable (e.g. CI network restrictions) — skip
test
+ Assumptions.assumeTrue(false, "External site unreachable: " +
e.getMessage());
Review Comment:
by default, it should be available. if we use an assume we won't notice that
the test is no more passing given that the number of skipped tests is too high
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]