Skip to content

Commit

Permalink
Migrate Digital Twins tests to TestProxy (Azure#35997)
Browse files Browse the repository at this point in the history
  • Loading branch information
srnagar authored Jul 20, 2023
1 parent 3914164 commit 4faf9ee
Show file tree
Hide file tree
Showing 64 changed files with 12 additions and 23,965 deletions.
6 changes: 6 additions & 0 deletions sdk/digitaltwins/azure-digitaltwins-core/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/digitaltwins/azure-digitaltwins-core",
"Tag": "java/digitaltwins/azure-digitaltwins-core_329ebe0bf8"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
import com.azure.core.http.policy.HttpLogDetailLevel;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.test.TestBase;
import com.azure.core.test.TestMode;
import com.azure.core.test.TestProxyTestBase;
import com.azure.core.test.models.CustomMatcher;
import com.azure.core.util.Configuration;
import com.azure.identity.ClientSecretCredentialBuilder;
import com.fasterxml.jackson.core.JsonProcessingException;
Expand All @@ -20,9 +21,10 @@
import reactor.core.publisher.Mono;

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

public class DigitalTwinsTestBase extends TestBase {
public class DigitalTwinsTestBase extends TestProxyTestBase {
private static final String PLAYBACK_ENDPOINT = "https://playback.api.wus2.digitaltwins.azure.net";
private static final int DEFAULT_WAIT_TIME_IN_SECONDS = 5;

Expand All @@ -49,6 +51,8 @@ protected DigitalTwinsClientBuilder getDigitalTwinsClientBuilder(HttpClient http
builder.credential(new FakeCredentials());
// Connect to a special host when running tests in playback mode.
builder.endpoint(PLAYBACK_ENDPOINT);
interceptorManager.addMatchers(Arrays.asList(new CustomMatcher().setHeadersKeyOnlyMatch(Arrays.asList("Telemetry-Source-Time"))));

return builder;
}

Expand Down

This file was deleted.

Loading

0 comments on commit 4faf9ee

Please sign in to comment.