你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

RecordedData Class

  • java.lang.Object
    • com.azure.core.test.models.RecordedData

public class 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 RecordedData to manage network calls and variables in a test session.

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.

NetworkCallRecord findFirstAndRemoveNetworkCall(Predicate<NetworkCallRecord> isMatch)

Finds the first matching NetworkCallRecord based on the predicate, removes it from the current network calls, and returns it.

String removeVariable()

Removes the first variable from the list and returns it.

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:

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.

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:

isMatch - Predicate to match for a given network call.

Returns:

The first NetworkCallRecord that matched isMatch, otherwise null if no network call could be matched.

removeVariable

public String removeVariable()

Removes the first variable from the list and returns it.

Returns:

The first variable.

Applies to