NetworkCallRecord Class

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

public class NetworkCallRecord

Keeps track of network call records from each unit test session.

Constructor Summary

Constructor Description
NetworkCallRecord()

Method Summary

Modifier and Type Method and Description
NetworkCallError getException()

Gets the throwable thrown during evaluation of the network call.

Map<String,String> getHeaders()

Gets the HTTP headers for the network call.

String getMethod()

Gets the HTTP method for with this network call

Map<String,String> getResponse()

Gets the contents of the HTTP response as a map of its HTTP headers and response body.

String getUri()

Gets the URL for this network call.

void setException(NetworkCallError exception)

Sets the throwable thrown during evaluation of the network call.

void setHeaders(Map<String,String> headers)

Sets the HTTP headers for the network call.

void setMethod(String method)

Sets the HTTP method for with this network call

void setResponse(Map<String,String> response)

Sets the contents of the HTTP response as a map of its HTTP headers and response body.

void setUri(String uri)

Sets the URL for this network call.

Methods inherited from java.lang.Object

Constructor Details

NetworkCallRecord

public NetworkCallRecord()

Method Details

getException

public NetworkCallError getException()

Gets the throwable thrown during evaluation of the network call.

Returns:

Throwable thrown during the network call.

getHeaders

public Map getHeaders()

Gets the HTTP headers for the network call.

Returns:

The HTTP headers for the network call.

getMethod

public String getMethod()

Gets the HTTP method for with this network call

Returns:

The HTTP method.

getResponse

public Map getResponse()

Gets the contents of the HTTP response as a map of its HTTP headers and response body. The HTTP response body is mapped under key "Body".

Returns:

Contents of the HTTP response.

getUri

public String getUri()

Gets the URL for this network call.

Returns:

The URL for this network call.

setException

public void setException(NetworkCallError exception)

Sets the throwable thrown during evaluation of the network call.

Parameters:

exception - Throwable thrown during the network call.

setHeaders

public void setHeaders(Map headers)

Sets the HTTP headers for the network call.

Parameters:

headers - The HTTP headers for the network call.

setMethod

public void setMethod(String method)

Sets the HTTP method for with this network call

Parameters:

method - HTTP method for this network call.

setResponse

public void setResponse(Map response)

Sets the contents of the HTTP response as a map of its HTTP headers and response body. The HTTP response body is mapped under key "body".

Parameters:

response - Contents of the HTTP response.

setUri

public void setUri(String uri)

Sets the URL for this network call.

Parameters:

uri - The URL for this network call.

Applies to