TestContextManager Class
- java.
lang. Object - com.
azure. core. test. TestContextManager
- com.
public class TestContextManager
This class handles managing context about a test, such as custom testing annotations and verifying whether the test is capable of running.
Constructor Summary
Constructor | Description |
---|---|
TestContextManager(Method testMethod, TestMode testMode) |
Constructs a TestContextManager based on the test method. |
TestContextManager(Method testMethod, TestMode testMode, boolean enableTestProxy, boolean recordWithoutRequestBodyClassAnnotation, Path testClassPath) |
Constructs a TestContextManager based on the test method. |
TestContextManager(Method testMethod, TestMode testMode, boolean enableTestProxy, boolean recordWithoutRequestBodyClassAnnotation, Path testClassPath, String trackerTestName) |
Constructs a TestContextManager based on the test method. |
Method Summary
Modifier and Type | Method and Description |
---|---|
boolean |
didTestRun()
Returns whether the current test was ran. |
boolean |
doNotRecordTest()
Returns whether the test should have its network calls recorded during a RECORD test run. |
Test |
getTestMode()
Returns the mode being used to run tests. |
String |
getTestName()
Returns the name of the test being ran. |
String |
getTestPlaybackRecordingName()
Returns the name of the playback record for the test being ran. |
String |
getTrackerTestName()
Gets the formatted name of the test used to log and track its progress. |
boolean |
isTestProxyEnabled()
Returns if the test proxy is enabled |
void |
setTestIteration(Integer testIteration)
Sets the test iteration for parameterized tests. |
boolean |
skipRecordingRequestBody()
Returns whether the test is recording request body when run RECORD mode. |
Methods inherited from java.lang.Object
Constructor Details
TestContextManager
public TestContextManager(Method testMethod, TestMode testMode)
Constructs a TestContextManager based on the test method.
Parameters:
TestContextManager
public TestContextManager(Method testMethod, TestMode testMode, boolean enableTestProxy, boolean recordWithoutRequestBodyClassAnnotation, Path testClassPath)
Constructs a TestContextManager based on the test method.
Parameters:
RecordWithoutRequestBody
annotation
present on test class.
TestContextManager
public TestContextManager(Method testMethod, TestMode testMode, boolean enableTestProxy, boolean recordWithoutRequestBodyClassAnnotation, Path testClassPath, String trackerTestName)
Constructs a TestContextManager based on the test method.
Parameters:
RecordWithoutRequestBody
annotation
present on test class.
Method Details
didTestRun
public boolean didTestRun()
Returns whether the current test was ran.
Returns:
doNotRecordTest
public boolean doNotRecordTest()
Returns whether the test should have its network calls recorded during a RECORD test run.
Returns:
getTestMode
public TestMode getTestMode()
Returns the mode being used to run tests.
Returns:
getTestName
public String getTestName()
Returns the name of the test being ran.
Returns:
getTestPlaybackRecordingName
public String getTestPlaybackRecordingName()
Returns the name of the playback record for the test being ran.
Returns:
getTrackerTestName
public String getTrackerTestName()
Gets the formatted name of the test used to log and track its progress.
Returns:
isTestProxyEnabled
public boolean isTestProxyEnabled()
Returns if the test proxy is enabled
Returns:
setTestIteration
public void setTestIteration(Integer testIteration)
Sets the test iteration for parameterized tests.
Parameters:
skipRecordingRequestBody
public boolean skipRecordingRequestBody()
Returns whether the test is recording request body when run RECORD mode.
Returns:
Applies to
Azure SDK for Java