Skip to content

Commit

Permalink
Add disabled bearer integ test
Browse files Browse the repository at this point in the history
  • Loading branch information
gosar committed Oct 3, 2023
1 parent 7017df5 commit 9654d4b
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,31 @@
import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Test;
import org.junit.jupiter.api.Disabled;
import software.amazon.awssdk.auth.token.credentials.ProfileTokenProvider;
import software.amazon.awssdk.auth.token.credentials.StaticTokenProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.codecatalyst.model.ListSpacesResponse;
import software.amazon.awssdk.testutils.service.AwsIntegrationTestBase;
import software.amazon.awssdk.testutils.service.http.MockAsyncHttpClient;
import software.amazon.awssdk.testutils.service.http.MockSyncHttpClient;

public class BearerCredentialTest extends AwsIntegrationTestBase {

/*
The test is disabled because it requires a codecatalyst profile that requires a human to run:
`aws sso login --profile codecatalyst` before running this test. But leaving the test code here, so one can manually run it
locally if needed.
*/
@Disabled
@Test
public void realClientSucceeds() {
CodeCatalystClient client = CodeCatalystClient.builder()
.tokenProvider(ProfileTokenProvider.create("codecatalyst"))
.build();
ListSpacesResponse result = client.listSpaces(r -> {});
assertThat(result.items()).isNotNull();
}
@Test
public void syncClientSendsBearerToken() {
try (MockSyncHttpClient httpClient = new MockSyncHttpClient();
Expand Down

0 comments on commit 9654d4b

Please sign in to comment.