Skip to content

Commit 85cd5ba

Browse files
committed
fix: wrap entire ServiceOptions creation in try-catch for CI
The IllegalStateException is thrown during ServiceOptions.build() when credential discovery fails, not during ApiUserService construction. Moving the entire options creation inside the try-catch ensures the exception is properly caught in CI environments where no credentials exist.
1 parent 197a3a1 commit 85cd5ba

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

java/src/test/java/co/meshtrade/api/iam/api_user/v1/ApiUserServiceIntegrationTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -517,15 +517,15 @@ void serviceCreationWithExplicitCredentialsOverride() throws IOException, Interr
517517
@Test
518518
@DisplayName("Service creation without credentials")
519519
void serviceCreationWithoutCredentials() {
520-
// Create service without any credentials - should fall back to discovery
521-
ServiceOptions options = ServiceOptions.builder()
522-
.url("localhost")
523-
.timeout(Duration.ofMillis(100))
524-
.build();
525-
526520
// In test environments (like CI), credential discovery will fail with IllegalStateException
527521
// In local environments with credentials, it should succeed
528522
try {
523+
// Create service without any credentials - should fall back to discovery
524+
ServiceOptions options = ServiceOptions.builder()
525+
.url("localhost")
526+
.timeout(Duration.ofMillis(100))
527+
.build();
528+
529529
ApiUserService service = new ApiUserService(options);
530530

531531
// If we get here, credentials were found - test that service works

0 commit comments

Comments
 (0)