RecordedData Class
- java.
lang. Object - com.
azure. core. test. models. RecordedData
- com.
Implements
public class RecordedData
implements JsonSerializable<RecordedData>
Keeps track of the network calls and variable names that were made in a test session.
Constructor Summary
| Constructor | Description |
|---|---|
| RecordedData() |
Creates a new instance of Recorded |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| void |
addNetworkCall(NetworkCallRecord record)
Adds a network call to the end of the list. |
| void |
addVariable(String variable)
Adds a variable to the end of the list. |
|
Network |
findFirstAndRemoveNetworkCall(Predicate<NetworkCallRecord> isMatch)
Finds the first matching NetworkCallRecord based on the predicate, removes it from the current network calls, and returns it. |
|
static
Recorded |
fromJson(JsonReader jsonReader)
Deserializes an instance of Recorded |
| String |
removeVariable()
Removes the first variable from the list and returns it. |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from java.lang.Object
Constructor Details
RecordedData
public RecordedData()
Creates a new instance of RecordedData to manage network calls and variables in a test session.
Method Details
addNetworkCall
public void addNetworkCall(NetworkCallRecord record)
Adds a network call to the end of the list.
Parameters:
addVariable
public void addVariable(String variable)
Adds a variable to the end of the list.
Parameters:
findFirstAndRemoveNetworkCall
public NetworkCallRecord findFirstAndRemoveNetworkCall(Predicate<NetworkCallRecord> isMatch)
Finds the first matching NetworkCallRecord based on the predicate, removes it from the current network calls, and returns it. null is returned if network call could not be matched.
Parameters:
Returns:
isMatch, otherwise null if no network
call could be matched.fromJson
public static RecordedData fromJson(JsonReader jsonReader)
Deserializes an instance of RecordedData from the input JSON.
Parameters:
Returns:
Throws:
removeVariable
public String removeVariable()
Removes the first variable from the list and returns it.
Returns: