Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crt/aws-c-cal
2 changes: 1 addition & 1 deletion crt/aws-c-http
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import java.util.List;
import java.util.concurrent.*;

import software.amazon.awssdk.crt.Log;

import static org.junit.Assert.*;
import static org.junit.Assert.fail;

Expand Down Expand Up @@ -297,18 +299,18 @@ public void testCreateDestroyProfile_MissingCreds() throws ExecutionException, I
.withConfigFileNameOverride(confPath.toString()).withCredentialsFileNameOverride(credsPath.toString());

try (ProfileCredentialsProvider provider = builder.build()) {
assertNotNull(provider);
assertNotNull("provider is null", provider);
assertTrue(provider.getNativeHandle() != 0);

try {
provider.getCredentials().join();
fail("Expected credential fetching to throw an exception since creds are missing from profile");
} catch (CompletionException e) {
assertNotNull(e.getCause());
assertNotNull("exception is null", e.getCause());
Throwable innerException = e.getCause();

// Check that the right exception type caused the completion error in the future
assertTrue(innerException.getMessage().contains("Parser encountered an error"));
assertEquals(innerException.getMessage(), "Valid credentials could not be sourced by a profile provider");
assertEquals(CrtRuntimeException.class, innerException.getClass());
}
} finally {
Expand Down
Loading