Class RecordedData
- java.lang.Object
-
- com.azure.android.core.test.models.RecordedData
-
public class RecordedData extends java.lang.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 void
addNetworkCall(NetworkCallRecord record)
Adds a network call to the end of the list.void
addVariable(java.lang.String variable)
Adds a variable to the end of the list.NetworkCallRecord
findFirstAndRemoveNetworkCall(java.util.function.Predicate<NetworkCallRecord> isMatch)
Finds the first matchingNetworkCallRecord
based on the predicate, removes it from the current network calls, and returns it.java.lang.String
removeVariable()
Removes the first variable from the list and returns it.
-
-
-
Method Detail
-
findFirstAndRemoveNetworkCall
public NetworkCallRecord findFirstAndRemoveNetworkCall(java.util.function.Predicate<NetworkCallRecord> isMatch)
Finds the first matchingNetworkCallRecord
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:
isMatch
- Predicate to match for a given network call.- Returns:
- The first
NetworkCallRecord
that matchedisMatch
, otherwisenull
if 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(java.lang.String variable)
Adds a variable to the end of the list.- Parameters:
variable
- The variable to add to the list.
-
removeVariable
public java.lang.String removeVariable()
Removes the first variable from the list and returns it.- Returns:
- The first variable.
-
-