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 d7d3892 commit 68145d2
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,29 @@
import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Test;
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.
*/
// @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 68145d2

Please sign in to comment.