Package com.azure.common.test.models
Class RecordedData
- java.lang.Object
-
- com.azure.common.test.models.RecordedData
-
public class RecordedData extends Object
Keeps track of the network calls and variable names that were made in a test session.
-
-
Constructor Summary
Constructors Constructor Description RecordedData()Creates a new instance of RecordedData to manage network calls and variables in a test session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNetworkCall(NetworkCallRecord record)Adds a network call to the end of the list.voidaddVariable(String variable)Adds a variable to the end of the list.NetworkCallRecordfindFirstAndRemoveNetworkCall(Predicate<NetworkCallRecord> isMatch)Finds the first matchingNetworkCallRecordbased on the predicate, removes it from the current network calls, and returns it.StringremoveVariable()Removes the first variable from the list and returns it.
-
-
-
Method Detail
-
findFirstAndRemoveNetworkCall
public NetworkCallRecord findFirstAndRemoveNetworkCall(Predicate<NetworkCallRecord> isMatch)
Finds the first matchingNetworkCallRecordbased on the predicate, removes it from the current network calls, and returns it.nullis returned if network call could not be matched.- Parameters:
isMatch- Predicate to match for a given network call.- Returns:
- The first
NetworkCallRecordthat matchedisMatch, otherwisenullif no network call could be matched.
-
addNetworkCall
public void addNetworkCall(NetworkCallRecord record)
Adds a network call to the end of the list.- Parameters:
record- The record to add.
-
addVariable
public void addVariable(String variable)
Adds a variable to the end of the list.- Parameters:
variable- The variable to add to the list.
-
removeVariable
public String removeVariable()
Removes the first variable from the list and returns it.- Returns:
- The first variable.
-
-