Package com.azure.core.test
Class TestContextManager
- java.lang.Object
-
- com.azure.core.test.TestContextManager
-
public class TestContextManager extends Object
This class handles managing context about a test, such as custom testing annotations and verifying whether the test is capable of running.
-
-
Constructor Summary
Constructors Constructor Description TestContextManager(Method testMethod, TestMode testMode)Constructs aTestContextManagerbased on the test method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandidTestRun()Returns whether the current test was ran.booleandoNotRecordTest()Returns whether the test should have its network calls recorded during arecordtest run.TestModegetTestMode()Returns the mode being used to run tests.StringgetTestName()Returns the name of the test being ran.StringgetTestPlaybackRecordingName()Returns the name of the playback record for the test being ran.
-
-
-
Constructor Detail
-
TestContextManager
public TestContextManager(Method testMethod, TestMode testMode)
Constructs aTestContextManagerbased on the test method.- Parameters:
testMethod- Test method being ran.testMode- TheTestModethe test is running in.
-
-
Method Detail
-
getTestName
public String getTestName()
Returns the name of the test being ran.- Returns:
- The test name.
-
getTestPlaybackRecordingName
public String getTestPlaybackRecordingName()
Returns the name of the playback record for the test being ran.- Returns:
- The playback record name.
-
getTestMode
public TestMode getTestMode()
Returns the mode being used to run tests.- Returns:
- The
TestModebeing used to run tests.
-
doNotRecordTest
public boolean doNotRecordTest()
Returns whether the test should have its network calls recorded during arecordtest run.- Returns:
- Flag indicating whether to record test network calls.
-
didTestRun
public boolean didTestRun()
Returns whether the current test was ran.- Returns:
- Flag indicating whether the current test was ran.
-
-