共用方式為


TestProxySanitizer Class

  • java.lang.Object
    • com.azure.core.test.models.TestProxySanitizer

public class TestProxySanitizer

Keeps track of different sanitizers that redact the sensitive information when recording

Constructor Summary

Constructor Description
TestProxySanitizer(String regex, String redactedValue, TestProxySanitizerType testProxySanitizerType)

Creates an instance of TestProxySanitizer with regex

TestProxySanitizer(String key, String regex, String redactedValue, TestProxySanitizerType testProxySanitizerType)

Creates an instance of TestProxySanitizer for a key with specified regex pattern

Method Summary

Modifier and Type Method and Description
String getGroupForReplace()

Get the group for replace

String getKey()

Get the header or body json key that is being redacted.

String getRedactedValue()

Get the replacement for regex matched content

String getRegex()

Get the regex to apply for redaction

TestProxySanitizerType getType()

Get the type of proxy sanitizer

TestProxySanitizer setGroupForReplace(String groupForReplace)

Set the group for replace.

Methods inherited from java.lang.Object

Constructor Details

TestProxySanitizer

public TestProxySanitizer(String regex, String redactedValue, TestProxySanitizerType testProxySanitizerType)

Creates an instance of TestProxySanitizer with regex

Parameters:

regex - the regex to apply for redaction
redactedValue - the replacement text for the regex matched content
testProxySanitizerType - the type of sanitizer

TestProxySanitizer

public TestProxySanitizer(String key, String regex, String redactedValue, TestProxySanitizerType testProxySanitizerType)

Creates an instance of TestProxySanitizer for a key with specified regex pattern

Parameters:

key - the body json key ("$..apiKey", "$..resourceId") or header key("Location") to apply regex to
regex - the regex to apply for redaction
redactedValue - the replacement text for the regex matched content
testProxySanitizerType - the type of sanitizer

Method Details

getGroupForReplace

public String getGroupForReplace()

Get the group for replace

Returns:

the group for replace.

getKey

public String getKey()

Get the header or body json key that is being redacted.

Returns:

the header or body json key being redacted.

getRedactedValue

public String getRedactedValue()

Get the replacement for regex matched content

Returns:

the replacement for regex matched content

getRegex

public String getRegex()

Get the regex to apply for redaction

Returns:

the regex to apply for redaction

getType

public TestProxySanitizerType getType()

Get the type of proxy sanitizer

Returns:

the type of proxy sanitizer

setGroupForReplace

public TestProxySanitizer setGroupForReplace(String groupForReplace)

Set the group for replace.

Parameters:

groupForReplace - The name of the group to replace.

Returns:

the TestProxySanitizer itself.

Applies to