azure-docs-sdk-java/docs-ref-autogen/com.azure.core.test.Interce...

326 строки
32 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.core.test.InterceptorManager"
fullName: "com.azure.core.test.InterceptorManager"
name: "InterceptorManager"
nameWithType: "InterceptorManager"
summary: "A class that keeps track of network calls by either reading the data from an existing test session record or recording the network calls in memory."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public class **InterceptorManager**</br> implements <a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html\">AutoCloseable</a>"
constructors:
- uid: "com.azure.core.test.InterceptorManager.InterceptorManager(com.azure.core.test.TestContextManager)"
fullName: "com.azure.core.test.InterceptorManager.InterceptorManager(TestContextManager testContextManager)"
name: "InterceptorManager(TestContextManager testContextManager)"
nameWithType: "InterceptorManager.InterceptorManager(TestContextManager testContextManager)"
summary: "Creates a new Interceptor<wbr>Manager that either replays test-session records or saves them."
parameters:
- description: "Contextual information about the test being ran, such as test name, <xref uid=\"com.azure.core.test.TestMode\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestMode\"></xref>,\n and others."
name: "testContextManager"
type: "<xref href=\"com.azure.core.test.TestContextManager?alt=com.azure.core.test.TestContextManager&text=TestContextManager\" data-throw-if-not-resolved=\"False\" />"
syntax: "public InterceptorManager(TestContextManager testContextManager)"
desc: "Creates a new InterceptorManager that either replays test-session records or saves them.\n\n * If `testMode` is <xref uid=\"com.azure.core.test.TestMode.PLAYBACK\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestMode#PLAYBACK\"></xref>, the manager tries to find an existing test session record to read network calls from.\n * If `testMode` is <xref uid=\"com.azure.core.test.TestMode.RECORD\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestMode#RECORD\"></xref>, the manager creates a new test session record and saves all the network calls to it.\n * If `testMode` is <xref uid=\"com.azure.core.test.TestMode.LIVE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestMode#LIVE\"></xref>, the manager won't attempt to read or create a test session record.\n\nThe test session records are persisted in the path: \"*session-records/`testName`.json*\""
- uid: "com.azure.core.test.InterceptorManager.InterceptorManager(java.lang.String,com.azure.core.test.TestMode)"
fullName: "com.azure.core.test.InterceptorManager.InterceptorManager(String testName, TestMode testMode)"
name: "InterceptorManager(String testName, TestMode testMode)"
nameWithType: "InterceptorManager.InterceptorManager(String testName, TestMode testMode)"
summary: "Creates a new Interceptor<wbr>Manager that either replays test-session records or saves them."
deprecatedTag: "Use <xref uid=\"com.azure.core.test.InterceptorManager.InterceptorManager(com.azure.core.test.TestContextManager)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#InterceptorManager(TestContextManager)\"></xref> instead."
parameters:
- description: "Name of the test session record."
name: "testName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "The <xref uid=\"com.azure.core.test.TestMode\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestMode\"></xref> for this interceptor."
name: "testMode"
type: "<xref href=\"com.azure.core.test.TestMode?alt=com.azure.core.test.TestMode&text=TestMode\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public InterceptorManager(String testName, TestMode testMode)"
desc: "Creates a new InterceptorManager that either replays test-session records or saves them.\n\n * If `testMode` is <xref uid=\"com.azure.core.test.TestMode.PLAYBACK\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestMode#PLAYBACK\"></xref>, the manager tries to find an existing test session record to read network calls from.\n * If `testMode` is <xref uid=\"com.azure.core.test.TestMode.RECORD\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestMode#RECORD\"></xref>, the manager creates a new test session record and saves all the network calls to it.\n\nThe test session records are persisted in the path: \"*session-records/`testName`.json*\""
hasDeprecatedTag: true
- uid: "com.azure.core.test.InterceptorManager.InterceptorManager(java.lang.String,java.util.Map<java.lang.String,java.lang.String>)"
fullName: "com.azure.core.test.InterceptorManager.InterceptorManager(String testName, Map<String,String> textReplacementRules)"
name: "InterceptorManager(String testName, Map<String,String> textReplacementRules)"
nameWithType: "InterceptorManager.InterceptorManager(String testName, Map<String,String> textReplacementRules)"
summary: "Creates a new Interceptor<wbr>Manager that replays test session records."
deprecatedTag: "Use <xref uid=\"com.azure.core.test.InterceptorManager.InterceptorManager(java.lang.String,java.util.Map<java.lang.String,java.lang.String>,boolean)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#InterceptorManager(String, Map, boolean)\"></xref> instead."
parameters:
- description: "Name of the test session record."
name: "testName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "A set of rules to replace text in <xref uid=\"com.azure.core.test.models.NetworkCallRecord.getResponse()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NetworkCallRecord#getResponse()\"></xref> when\n playing back network calls."
name: "textReplacementRules"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public InterceptorManager(String testName, Map<String,String> textReplacementRules)"
desc: "Creates a new InterceptorManager that replays test session records. It takes a set of `textReplacementRules`, that can be used by <xref uid=\"com.azure.core.test.http.PlaybackClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PlaybackClient\"></xref> to replace values in a <xref uid=\"com.azure.core.test.models.NetworkCallRecord.getResponse()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NetworkCallRecord#getResponse()\"></xref>. The test session records are read from: \"*session-records/`testName`.json*\""
hasDeprecatedTag: true
- uid: "com.azure.core.test.InterceptorManager.InterceptorManager(java.lang.String,java.util.Map<java.lang.String,java.lang.String>,boolean)"
fullName: "com.azure.core.test.InterceptorManager.InterceptorManager(String testName, Map<String,String> textReplacementRules, boolean doNotRecord)"
name: "InterceptorManager(String testName, Map<String,String> textReplacementRules, boolean doNotRecord)"
nameWithType: "InterceptorManager.InterceptorManager(String testName, Map<String,String> textReplacementRules, boolean doNotRecord)"
summary: "Creates a new Interceptor<wbr>Manager that replays test session records."
deprecatedTag: "Use <xref uid=\"com.azure.core.test.InterceptorManager.InterceptorManager(java.lang.String,java.util.Map<java.lang.String,java.lang.String>,boolean,java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#InterceptorManager(String, Map, boolean, String)\"></xref> instead."
parameters:
- description: "Name of the test session record."
name: "testName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "A set of rules to replace text in <xref uid=\"com.azure.core.test.models.NetworkCallRecord.getResponse()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NetworkCallRecord#getResponse()\"></xref> when\n playing back network calls."
name: "textReplacementRules"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "Flag indicating whether network calls should be record or played back."
name: "doNotRecord"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
syntax: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html\">@Deprecated</a></br>public InterceptorManager(String testName, Map<String,String> textReplacementRules, boolean doNotRecord)"
desc: "Creates a new InterceptorManager that replays test session records. It takes a set of `textReplacementRules`, that can be used by <xref uid=\"com.azure.core.test.http.PlaybackClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PlaybackClient\"></xref> to replace values in a <xref uid=\"com.azure.core.test.models.NetworkCallRecord.getResponse()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NetworkCallRecord#getResponse()\"></xref>. The test session records are read from: \"*session-records/`testName`.json*\""
hasDeprecatedTag: true
- uid: "com.azure.core.test.InterceptorManager.InterceptorManager(java.lang.String,java.util.Map<java.lang.String,java.lang.String>,boolean,java.lang.String)"
fullName: "com.azure.core.test.InterceptorManager.InterceptorManager(String testName, Map<String,String> textReplacementRules, boolean doNotRecord, String playbackRecordName)"
name: "InterceptorManager(String testName, Map<String,String> textReplacementRules, boolean doNotRecord, String playbackRecordName)"
nameWithType: "InterceptorManager.InterceptorManager(String testName, Map<String,String> textReplacementRules, boolean doNotRecord, String playbackRecordName)"
summary: "Creates a new Interceptor<wbr>Manager that replays test session records."
parameters:
- description: "Name of the test."
name: "testName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "A set of rules to replace text in <xref uid=\"com.azure.core.test.models.NetworkCallRecord.getResponse()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NetworkCallRecord#getResponse()\"></xref> when\n playing back network calls."
name: "textReplacementRules"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/Map.html\">Map</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- description: "Flag indicating whether network calls should be record or played back."
name: "doNotRecord"
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- description: "Full name of the test including its iteration, used as the playback record name."
name: "playbackRecordName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public InterceptorManager(String testName, Map<String,String> textReplacementRules, boolean doNotRecord, String playbackRecordName)"
desc: "Creates a new InterceptorManager that replays test session records. It takes a set of `textReplacementRules`, that can be used by <xref uid=\"com.azure.core.test.http.PlaybackClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PlaybackClient\"></xref> to replace values in a <xref uid=\"com.azure.core.test.models.NetworkCallRecord.getResponse()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"NetworkCallRecord#getResponse()\"></xref>. The test session records are read from: \"*session-records/`testName`.json*\""
methods:
- uid: "com.azure.core.test.InterceptorManager.addMatchers(com.azure.core.test.models.TestProxyRequestMatcher...)"
fullName: "com.azure.core.test.InterceptorManager.addMatchers(TestProxyRequestMatcher[] testProxyRequestMatchers)"
name: "addMatchers(TestProxyRequestMatcher[] testProxyRequestMatchers)"
nameWithType: "InterceptorManager.addMatchers(TestProxyRequestMatcher[] testProxyRequestMatchers)"
summary: "Add matcher rules to match recorded data in playback."
parameters:
- description: "the list of matcher rules when playing back recorded data."
name: "testProxyRequestMatchers"
type: "<xref href=\"com.azure.core.test.models.TestProxyRequestMatcher?alt=com.azure.core.test.models.TestProxyRequestMatcher&text=TestProxyRequestMatcher\" data-throw-if-not-resolved=\"False\" />[]"
syntax: "public void addMatchers(TestProxyRequestMatcher[] testProxyRequestMatchers)"
desc: "Add matcher rules to match recorded data in playback. Matchers are only applied for playback session and so this will be a noop when invoked in RECORD/LIVE mode."
- uid: "com.azure.core.test.InterceptorManager.addMatchers(java.util.List<com.azure.core.test.models.TestProxyRequestMatcher>)"
fullName: "com.azure.core.test.InterceptorManager.addMatchers(List<TestProxyRequestMatcher> testProxyMatchers)"
name: "addMatchers(List<TestProxyRequestMatcher> testProxyMatchers)"
nameWithType: "InterceptorManager.addMatchers(List<TestProxyRequestMatcher> testProxyMatchers)"
summary: "Add matcher rules to match recorded data in playback."
parameters:
- description: "the list of matcher rules when playing back recorded data."
name: "testProxyMatchers"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<xref href=\"com.azure.core.test.models.TestProxyRequestMatcher?alt=com.azure.core.test.models.TestProxyRequestMatcher&text=TestProxyRequestMatcher\" data-throw-if-not-resolved=\"False\" />&gt;"
syntax: "public void addMatchers(List<TestProxyRequestMatcher> testProxyMatchers)"
desc: "Add matcher rules to match recorded data in playback. Matchers are only applied for playback session and so this will be a noop when invoked in RECORD/LIVE mode."
- uid: "com.azure.core.test.InterceptorManager.addSanitizers(com.azure.core.test.models.TestProxySanitizer...)"
fullName: "com.azure.core.test.InterceptorManager.addSanitizers(TestProxySanitizer[] testProxySanitizers)"
name: "addSanitizers(TestProxySanitizer[] testProxySanitizers)"
nameWithType: "InterceptorManager.addSanitizers(TestProxySanitizer[] testProxySanitizers)"
summary: "Add sanitizer rule for sanitization during record or playback."
parameters:
- description: "the list of replacement regex and rules."
name: "testProxySanitizers"
type: "<xref href=\"com.azure.core.test.models.TestProxySanitizer?alt=com.azure.core.test.models.TestProxySanitizer&text=TestProxySanitizer\" data-throw-if-not-resolved=\"False\" />[]"
syntax: "public void addSanitizers(TestProxySanitizer[] testProxySanitizers)"
desc: "Add sanitizer rule for sanitization during record or playback."
- uid: "com.azure.core.test.InterceptorManager.addSanitizers(java.util.List<com.azure.core.test.models.TestProxySanitizer>)"
fullName: "com.azure.core.test.InterceptorManager.addSanitizers(List<TestProxySanitizer> testProxySanitizers)"
name: "addSanitizers(List<TestProxySanitizer> testProxySanitizers)"
nameWithType: "InterceptorManager.addSanitizers(List<TestProxySanitizer> testProxySanitizers)"
summary: "Add sanitizer rule for sanitization during record or playback."
parameters:
- description: "the list of replacement regex and rules."
name: "testProxySanitizers"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<xref href=\"com.azure.core.test.models.TestProxySanitizer?alt=com.azure.core.test.models.TestProxySanitizer&text=TestProxySanitizer\" data-throw-if-not-resolved=\"False\" />&gt;"
syntax: "public void addSanitizers(List<TestProxySanitizer> testProxySanitizers)"
desc: "Add sanitizer rule for sanitization during record or playback."
- uid: "com.azure.core.test.InterceptorManager.addTextReplacementRule(java.lang.String,java.lang.String)"
fullName: "com.azure.core.test.InterceptorManager.addTextReplacementRule(String regex, String replacement)"
name: "addTextReplacementRule(String regex, String replacement)"
nameWithType: "InterceptorManager.addTextReplacementRule(String regex, String replacement)"
summary: "Add text replacement rule (regex as key, the replacement text as value) into <xref uid=\"com.azure.core.test.InterceptorManager.textReplacementRules\" data-throw-if-not-resolved=\"false\" data-raw-source=\"InterceptorManager#textReplacementRules\"></xref>"
parameters:
- description: "the pattern to locate the position of replacement"
name: "regex"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "the replacement text"
name: "replacement"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public void addTextReplacementRule(String regex, String replacement)"
desc: "Add text replacement rule (regex as key, the replacement text as value) into <xref uid=\"com.azure.core.test.InterceptorManager.textReplacementRules\" data-throw-if-not-resolved=\"false\" data-raw-source=\"InterceptorManager#textReplacementRules\"></xref>"
- uid: "com.azure.core.test.InterceptorManager.close()"
fullName: "com.azure.core.test.InterceptorManager.close()"
name: "close()"
nameWithType: "InterceptorManager.close()"
summary: "Disposes of resources used by this Interceptor<wbr>Manager."
syntax: "public void close()"
desc: "Disposes of resources used by this InterceptorManager. If `testMode` is <xref uid=\"com.azure.core.test.TestMode.RECORD\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestMode#RECORD\"></xref>, all the network calls are persisted to: \"*session-records/`testName`.json*\""
- uid: "com.azure.core.test.InterceptorManager.getPlaybackClient()"
fullName: "com.azure.core.test.InterceptorManager.getPlaybackClient()"
name: "getPlaybackClient()"
nameWithType: "InterceptorManager.getPlaybackClient()"
summary: "Gets a new HTTP client that plays back test session records managed by <xref uid=\"com.azure.core.test.InterceptorManager\" data-throw-if-not-resolved=\"false\" data-raw-source=\"InterceptorManager\"></xref>."
syntax: "public HttpClient getPlaybackClient()"
desc: "Gets a new HTTP client that plays back test session records managed by <xref uid=\"com.azure.core.test.InterceptorManager\" data-throw-if-not-resolved=\"false\" data-raw-source=\"InterceptorManager\"></xref>."
returns:
description: "An HTTP client that plays back network calls from its recorded data."
type: "<xref href=\"com.azure.core.http.HttpClient?alt=com.azure.core.http.HttpClient&text=HttpClient\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.test.InterceptorManager.getPlaybackRecordName()"
fullName: "com.azure.core.test.InterceptorManager.getPlaybackRecordName()"
name: "getPlaybackRecordName()"
nameWithType: "InterceptorManager.getPlaybackRecordName()"
summary: "Gets the name of the playback record."
syntax: "public String getPlaybackRecordName()"
desc: "Gets the name of the playback record.\n\nThe playback record name is equivalent to `.[]`."
returns:
description: "Name of the playback record."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.core.test.InterceptorManager.getProxyVariableConsumer()"
fullName: "com.azure.core.test.InterceptorManager.getProxyVariableConsumer()"
name: "getProxyVariableConsumer()"
nameWithType: "InterceptorManager.getProxyVariableConsumer()"
summary: "Get a <xref uid=\"java.util.function.Consumer\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Consumer\"></xref> for adding variables used in test proxy tests."
syntax: "public Consumer<String> getProxyVariableConsumer()"
desc: "Get a <xref uid=\"java.util.function.Consumer\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Consumer\"></xref> for adding variables used in test proxy tests."
returns:
description: "The consumer for adding a variable."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/Consumer.html\">Consumer</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- uid: "com.azure.core.test.InterceptorManager.getProxyVariableSupplier()"
fullName: "com.azure.core.test.InterceptorManager.getProxyVariableSupplier()"
name: "getProxyVariableSupplier()"
nameWithType: "InterceptorManager.getProxyVariableSupplier()"
summary: "A <xref uid=\"java.util.function.Supplier\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Supplier\"></xref> for retrieving a variable from a test proxy recording."
syntax: "public Supplier<String> getProxyVariableSupplier()"
desc: "A <xref uid=\"java.util.function.Supplier\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Supplier\"></xref> for retrieving a variable from a test proxy recording."
returns:
description: "The supplier for retrieving a variable."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html\">Supplier</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
- uid: "com.azure.core.test.InterceptorManager.getRecordPolicy()"
fullName: "com.azure.core.test.InterceptorManager.getRecordPolicy()"
name: "getRecordPolicy()"
nameWithType: "InterceptorManager.getRecordPolicy()"
summary: "Gets a new HTTP pipeline policy that records network calls and its data is managed by <xref uid=\"com.azure.core.test.InterceptorManager\" data-throw-if-not-resolved=\"false\" data-raw-source=\"InterceptorManager\"></xref>."
syntax: "public HttpPipelinePolicy getRecordPolicy()"
desc: "Gets a new HTTP pipeline policy that records network calls and its data is managed by <xref uid=\"com.azure.core.test.InterceptorManager\" data-throw-if-not-resolved=\"false\" data-raw-source=\"InterceptorManager\"></xref>."
returns:
description: "HttpPipelinePolicy to record network calls."
type: "<xref href=\"com.azure.core.http.policy.HttpPipelinePolicy?alt=com.azure.core.http.policy.HttpPipelinePolicy&text=HttpPipelinePolicy\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.test.InterceptorManager.getRecordPolicy(java.util.List<java.util.function.Function<java.lang.String,java.lang.String>>)"
fullName: "com.azure.core.test.InterceptorManager.getRecordPolicy(List<Function<String,String>> recordingRedactors)"
name: "getRecordPolicy(List<Function<String,String>> recordingRedactors)"
nameWithType: "InterceptorManager.getRecordPolicy(List<Function<String,String>> recordingRedactors)"
summary: "Gets a new HTTP pipeline policy that records network calls."
parameters:
- description: "The custom redactor functions that are applied in addition to the default redactor\n functions defined in <xref uid=\"com.azure.core.test.models.RecordingRedactor\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RecordingRedactor\"></xref>."
name: "recordingRedactors"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/List.html\">List</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html\">Function</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;&gt;"
syntax: "public HttpPipelinePolicy getRecordPolicy(List<Function<String,String>> recordingRedactors)"
desc: "Gets a new HTTP pipeline policy that records network calls. The recorded content is redacted by the given list of redactor functions to hide sensitive information."
returns:
description: "<xref uid=\"com.azure.core.http.policy.HttpPipelinePolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipelinePolicy\"></xref> to record network calls."
type: "<xref href=\"com.azure.core.http.policy.HttpPipelinePolicy?alt=com.azure.core.http.policy.HttpPipelinePolicy&text=HttpPipelinePolicy\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.test.InterceptorManager.getRecordedData()"
fullName: "com.azure.core.test.InterceptorManager.getRecordedData()"
name: "getRecordedData()"
nameWithType: "InterceptorManager.getRecordedData()"
summary: "Gets the recorded data Interceptor<wbr>Manager is keeping track of."
syntax: "public RecordedData getRecordedData()"
desc: "Gets the recorded data InterceptorManager is keeping track of."
returns:
description: "The recorded data managed by InterceptorManager."
type: "<xref href=\"com.azure.core.test.models.RecordedData?alt=com.azure.core.test.models.RecordedData&text=RecordedData\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.test.InterceptorManager.getRecordingFileLocation()"
fullName: "com.azure.core.test.InterceptorManager.getRecordingFileLocation()"
name: "getRecordingFileLocation()"
nameWithType: "InterceptorManager.getRecordingFileLocation()"
summary: "Get the recording file location in assets repo."
syntax: "public String getRecordingFileLocation()"
desc: "Get the recording file location in assets repo."
returns:
description: "the assets repo location of the recording file."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.core.test.InterceptorManager.getTestName()"
fullName: "com.azure.core.test.InterceptorManager.getTestName()"
name: "getTestName()"
nameWithType: "InterceptorManager.getTestName()"
summary: "Gets the name of the running test."
syntax: "public String getTestName()"
desc: "Gets the name of the running test."
returns:
description: "Name of the running test."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.core.test.InterceptorManager.isLiveMode()"
fullName: "com.azure.core.test.InterceptorManager.isLiveMode()"
name: "isLiveMode()"
nameWithType: "InterceptorManager.isLiveMode()"
summary: "Gets whether this Interceptor<wbr>Manager is in live mode."
syntax: "public boolean isLiveMode()"
desc: "Gets whether this InterceptorManager is in live mode."
returns:
description: "true if the InterceptorManager is in live mode and false otherwise."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.test.InterceptorManager.isPlaybackMode()"
fullName: "com.azure.core.test.InterceptorManager.isPlaybackMode()"
name: "isPlaybackMode()"
nameWithType: "InterceptorManager.isPlaybackMode()"
summary: "Gets whether this Interceptor<wbr>Manager is in playback mode."
syntax: "public boolean isPlaybackMode()"
desc: "Gets whether this InterceptorManager is in playback mode."
returns:
description: "true if the InterceptorManager is in playback mode and false otherwise."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.test.InterceptorManager.isRecordMode()"
fullName: "com.azure.core.test.InterceptorManager.isRecordMode()"
name: "isRecordMode()"
nameWithType: "InterceptorManager.isRecordMode()"
summary: "Gets whether this Interceptor<wbr>Manager is in record mode."
syntax: "public boolean isRecordMode()"
desc: "Gets whether this InterceptorManager is in record mode."
returns:
description: "true if the InterceptorManager is in record mode and false otherwise."
type: "<xref href=\"boolean?alt=boolean&text=boolean\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.core.test.InterceptorManager.removeSanitizers(java.lang.String...)"
fullName: "com.azure.core.test.InterceptorManager.removeSanitizers(String[] testProxySanitizersId)"
name: "removeSanitizers(String[] testProxySanitizersId)"
nameWithType: "InterceptorManager.removeSanitizers(String[] testProxySanitizersId)"
summary: "Disable common sanitizer rule for sanitization during record or playback."
parameters:
- description: "the list of sanitizer rule Id to disable."
name: "testProxySanitizersId"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>[]"
syntax: "public void removeSanitizers(String[] testProxySanitizersId)"
desc: "Disable common sanitizer rule for sanitization during record or playback."
- uid: "com.azure.core.test.InterceptorManager.setProxyRecordingOptions(com.azure.core.test.models.TestProxyRecordingOptions)"
fullName: "com.azure.core.test.InterceptorManager.setProxyRecordingOptions(TestProxyRecordingOptions testProxyRecordingOptions)"
name: "setProxyRecordingOptions(TestProxyRecordingOptions testProxyRecordingOptions)"
nameWithType: "InterceptorManager.setProxyRecordingOptions(TestProxyRecordingOptions testProxyRecordingOptions)"
summary: "Sets the recording options for the proxy."
parameters:
- description: "The <xref uid=\"com.azure.core.test.models.TestProxyRecordingOptions\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestProxyRecordingOptions\"></xref> to use."
name: "testProxyRecordingOptions"
type: "<xref href=\"com.azure.core.test.models.TestProxyRecordingOptions?alt=com.azure.core.test.models.TestProxyRecordingOptions&text=TestProxyRecordingOptions\" data-throw-if-not-resolved=\"False\" />"
syntax: "public void setProxyRecordingOptions(TestProxyRecordingOptions testProxyRecordingOptions)"
desc: "Sets the recording options for the proxy."
type: "class"
desc: "A class that keeps track of network calls by either reading the data from an existing test session record or recording the network calls in memory. Test session records are saved or read from: \"*session-records/`testName`.json*\"\n\n * If the `testMode` is <xref uid=\"com.azure.core.test.TestMode.PLAYBACK\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestMode#PLAYBACK\"></xref>, the manager tries to find an existing test session record to read network calls from.\n * If the `testMode` is <xref uid=\"com.azure.core.test.TestMode.RECORD\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestMode#RECORD\"></xref>, the manager creates a new test session record and saves all the network calls to it.\n * If the `testMode` is <xref uid=\"com.azure.core.test.TestMode.LIVE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestMode#LIVE\"></xref>, the manager won't attempt to read or create a test session record.\n\nWhen the <xref uid=\"com.azure.core.test.InterceptorManager\" data-throw-if-not-resolved=\"false\" data-raw-source=\"InterceptorManager\"></xref> is disposed, if the `testMode` is <xref uid=\"com.azure.core.test.TestMode.RECORD\" data-throw-if-not-resolved=\"false\" data-raw-source=\"TestMode#RECORD\"></xref>, the network calls that were recorded are persisted to: \"*session-records/`testName`.json*\""
implements:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html\">AutoCloseable</a>"
metadata: {}
package: "com.azure.core.test"
artifact: com.azure:azure-core-test:1.26.2