Skip to content

Commit

Permalink
add matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
samvaity committed Apr 10, 2023
1 parent f8d0ed0 commit 6e97102
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
});
Expand Down

0 comments on commit 6e97102

Please sign in to comment.