diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationAsyncClientTest.java b/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationAsyncClientTest.java index 4d990b3ca09af..008acf38571ed 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationAsyncClientTest.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationAsyncClientTest.java @@ -13,6 +13,7 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.Response; import com.azure.core.test.http.AssertingHttpClientBuilder; +import com.azure.core.test.models.CustomMatcher; import com.azure.core.util.logging.ClientLogger; import com.azure.data.appconfiguration.models.ConfigurationSetting; import com.azure.data.appconfiguration.models.FeatureFlagConfigurationSetting; @@ -30,6 +31,7 @@ import java.net.HttpURLConnection; import java.time.Duration; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.function.BiFunction; import java.util.stream.Collectors; @@ -81,6 +83,8 @@ private ConfigurationAsyncClient getConfigurationAsyncClient(HttpClient httpClie builder .addPolicy(interceptorManager.getRecordPolicy()) .addPolicy(new RetryPolicy()); + } else if (interceptorManager.isPlaybackMode()) { + interceptorManager.addMatchers(Arrays.asList(new CustomMatcher().setHeadersKeyOnlyMatch(Arrays.asList("Sync-Token")))); } return builder.buildAsyncClient(); }); diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationClientTest.java b/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationClientTest.java index 8d135b1a476de..85b8d8985c940 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationClientTest.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/ConfigurationClientTest.java @@ -13,6 +13,7 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.test.http.AssertingHttpClientBuilder; +import com.azure.core.test.models.CustomMatcher; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.data.appconfiguration.models.ConfigurationSetting; @@ -27,6 +28,7 @@ import java.net.HttpURLConnection; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.function.BiFunction; import java.util.stream.Collectors; @@ -76,6 +78,8 @@ private ConfigurationClient getConfigurationClient(HttpClient httpClient, builder .addPolicy(interceptorManager.getRecordPolicy()) .addPolicy(new RetryPolicy()); + } else if (interceptorManager.isPlaybackMode()) { + interceptorManager.addMatchers(Arrays.asList(new CustomMatcher().setHeadersKeyOnlyMatch(Arrays.asList("Sync-Token")))); } return builder.buildClient(); });