Package com.easypost.easyvcr
Class VCR
java.lang.Object
com.easypost.easyvcr.VCR
Built-in VCR tool for EasyVCR.
-
Constructor Summary
ConstructorsConstructorDescriptionVCR()Constructor for VCR.VCR(AdvancedSettings advancedSettings)Constructor for VCR. -
Method Summary
Modifier and TypeMethodDescriptionvoideject()Remove the current cassette from the VCR.voiderase()Erase the cassette in the VCR.Get the advanced settings for the VCR.Gets the name of the current cassette in the VCR.getHttpUrlConnection(String url)Retrieve a pre-configured RecordableURL object that will use the VCR.getHttpUrlConnection(URL url)Retrieve a pre-configured RecordableURL object that will use the VCR.getMode()Gets the current operating mode of the VCR.voidAdd a cassette to the VCR (or replace the current one).voidpause()Enable passthrough mode on the VCR (HTTP requests will be made as normal).voidrecord()Enable recording mode on the VCR.voidEnable auto mode on the VCR (record if needed, replay otherwise).voidreplay()Enable playback mode on the VCR.voidsetAdvancedSettings(AdvancedSettings advancedSettings)Set the advanced settings for the VCR.
-
Constructor Details
-
VCR
Constructor for VCR.- Parameters:
advancedSettings- Advanced settings for the VCR.
-
VCR
public VCR()Constructor for VCR.
-
-
Method Details
-
getCassetteName
Gets the name of the current cassette in the VCR.- Returns:
- The name of the current cassette in the VCR.
-
getHttpUrlConnection
Retrieve a pre-configured RecordableURL object that will use the VCR.- Parameters:
url- The URL to use to create the RecordableURL object.- Returns:
- A pre-configured RecordableURL object that will use the VCR.
- Throws:
MalformedURLException- If the URL is malformed.VCRException- If the cassette is not loaded.
-
getHttpUrlConnection
Retrieve a pre-configured RecordableURL object that will use the VCR.- Parameters:
url- The URL string to use to create the RecordableURL object.- Returns:
- A pre-configured RecordableURL object that will use the VCR.
- Throws:
MalformedURLException- If the URL is malformed.VCRException- If the cassette is not loaded.
-
getMode
Gets the current operating mode of the VCR.- Returns:
- The current operating mode of the VCR.
-
getAdvancedSettings
Get the advanced settings for the VCR.- Returns:
- Advanced settings for the VCR.
-
setAdvancedSettings
Set the advanced settings for the VCR.- Parameters:
advancedSettings- Advanced settings for the VCR.
-
eject
public void eject()Remove the current cassette from the VCR. -
erase
public void erase()Erase the cassette in the VCR. -
insert
Add a cassette to the VCR (or replace the current one).- Parameters:
cassette- The cassette to add to the VCR.
-
pause
public void pause()Enable passthrough mode on the VCR (HTTP requests will be made as normal). -
record
public void record()Enable recording mode on the VCR. -
replay
public void replay()Enable playback mode on the VCR. -
recordIfNeeded
public void recordIfNeeded()Enable auto mode on the VCR (record if needed, replay otherwise).
-