Skip to content

Commit

Permalink
take latest dep
Browse files Browse the repository at this point in the history
  • Loading branch information
samvaity committed Apr 15, 2023
1 parent 9f27390 commit b92e82c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
2 changes: 1 addition & 1 deletion sdk/metricsadvisor/azure-ai-metricsadvisor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-test</artifactId>
<version>1.16.0</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
<version>1.16.1</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@

import com.azure.ai.metricsadvisor.administration.MetricsAdvisorAdministrationClientBuilder;
import com.azure.ai.metricsadvisor.models.MetricsAdvisorKeyCredential;
import com.azure.core.credential.AccessToken;
import com.azure.core.credential.TokenCredential;
import com.azure.core.credential.TokenRequestContext;
import com.azure.core.http.HttpClient;
import com.azure.core.http.policy.HttpLogDetailLevel;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.test.TestProxyTestBase;
import com.azure.core.test.http.AssertingHttpClientBuilder;
import com.azure.core.test.models.BodilessMatcher;
import com.azure.core.test.models.CustomMatcher;
import com.azure.core.test.utils.MockTokenCredential;
import com.azure.core.util.Configuration;
import com.azure.identity.DefaultAzureCredentialBuilder;
import reactor.core.publisher.Mono;

import java.time.OffsetDateTime;
import java.util.Arrays;

import static com.azure.ai.metricsadvisor.MetricsAdvisorClientBuilderTest.PLAYBACK_ENDPOINT;
Expand Down Expand Up @@ -83,12 +79,7 @@ MetricsAdvisorAdministrationClientBuilder getMetricsAdvisorAdministrationBuilder
}
} else {
if (interceptorManager.isPlaybackMode()) {
builder.credential(new TokenCredential() {
@Override
public Mono<AccessToken> getToken(TokenRequestContext tokenRequestContext) {
return Mono.just(new AccessToken("mockToken", OffsetDateTime.now().plusHours(2)));
}
});
builder.credential(new MockTokenCredential());
interceptorManager.addMatchers(Arrays.asList(new BodilessMatcher()));
} else if (interceptorManager.isRecordMode()) {
builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@
package com.azure.ai.metricsadvisor;

import com.azure.ai.metricsadvisor.models.MetricsAdvisorKeyCredential;
import com.azure.core.credential.AccessToken;
import com.azure.core.credential.TokenCredential;
import com.azure.core.credential.TokenRequestContext;
import com.azure.core.http.HttpClient;
import com.azure.core.http.policy.HttpLogDetailLevel;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.test.TestProxyTestBase;
import com.azure.core.test.http.AssertingHttpClientBuilder;
import com.azure.core.test.models.BodilessMatcher;
import com.azure.core.test.models.CustomMatcher;
import com.azure.core.test.utils.MockTokenCredential;
import com.azure.core.util.Configuration;
import com.azure.identity.DefaultAzureCredentialBuilder;
import reactor.core.publisher.Mono;

import java.time.OffsetDateTime;
import java.util.Arrays;

import static com.azure.ai.metricsadvisor.TestUtils.AZURE_METRICS_ADVISOR_ENDPOINT;
Expand Down Expand Up @@ -75,12 +71,7 @@ MetricsAdvisorClientBuilder getMetricsAdvisorBuilderInternal(HttpClient httpClie
}
} else {
if (interceptorManager.isPlaybackMode()) {
builder.credential(new TokenCredential() {
@Override
public Mono<AccessToken> getToken(TokenRequestContext tokenRequestContext) {
return Mono.just(new AccessToken("mockToken", OffsetDateTime.now().plusHours(2)));
}
});
builder.credential(new MockTokenCredential());
// setting bodiless matcher to "exclude" matching request bodies with UUID's
interceptorManager.addMatchers(Arrays.asList(new BodilessMatcher()));
} else if (interceptorManager.isRecordMode()) {
Expand Down

0 comments on commit b92e82c

Please sign in to comment.