DataSourceContractTest.TestResource.Builder


public final class DataSourceContractTest.TestResource.Builder


Builder for TestResource instances.

Summary

Public constructors

Public methods

DataSourceContractTest.TestResource
DataSourceContractTest.TestResource.Builder
@CanIgnoreReturnValue
setExpectedBytes(byte[] expectedBytes)

Sets the expected contents of this resource.

DataSourceContractTest.TestResource.Builder

Sets a human-readable name for this resource which will be shown in test failure messages.

DataSourceContractTest.TestResource.Builder

Sets the URI where this resource is served from.

DataSourceContractTest.TestResource.Builder

Sets the URI where this resource is served from.

DataSourceContractTest.TestResource.Builder

Sets the headers associated with this resource that are expected to be present in getResponseHeaders.

DataSourceContractTest.TestResource.Builder
@CanIgnoreReturnValue
setUnexpectedResponseHeaderKeys(
    Set<String> unexpectedResponseHeaderKeys
)

Sets the keys that must not be present in getResponseHeaders when reading this resource.

DataSourceContractTest.TestResource.Builder

Sets the URI where this resource should be requested from.

DataSourceContractTest.TestResource.Builder

Sets the URI where this resource should be requested from.

Public constructors

Builder

public Builder()

Public methods

setExpectedBytes

@CanIgnoreReturnValue
public DataSourceContractTest.TestResource.Builder setExpectedBytes(byte[] expectedBytes)

Sets the expected contents of this resource. Defaults to an empty byte array.

setName

@CanIgnoreReturnValue
public DataSourceContractTest.TestResource.Builder setName(String name)

Sets a human-readable name for this resource which will be shown in test failure messages.

setResolvedUri

@CanIgnoreReturnValue
public DataSourceContractTest.TestResource.Builder setResolvedUri(String uri)

Sets the URI where this resource is served from. This only needs to be explicitly set if it's different to setUri. See getResolvedUri.

setResolvedUri

@CanIgnoreReturnValue
public DataSourceContractTest.TestResource.Builder setResolvedUri(Uri uri)

Sets the URI where this resource is served from. This only needs to be explicitly set if it's different to setUri. See getResolvedUri.

setResponseHeaders

@CanIgnoreReturnValue
public DataSourceContractTest.TestResource.Builder setResponseHeaders(Map<StringList<String>> responseHeaders)

Sets the headers associated with this resource that are expected to be present in getResponseHeaders.

This doesn't have to be an exhaustive list, extra headers in getResponseHeaders are ignored. Defaults to an empty map.

setUnexpectedResponseHeaderKeys

@CanIgnoreReturnValue
public DataSourceContractTest.TestResource.Builder setUnexpectedResponseHeaderKeys(
    Set<String> unexpectedResponseHeaderKeys
)

Sets the keys that must not be present in getResponseHeaders when reading this resource. Defaults to an empty set.

setUri

@CanIgnoreReturnValue
public DataSourceContractTest.TestResource.Builder setUri(String uri)

Sets the URI where this resource should be requested from.

setUri

@CanIgnoreReturnValue
public DataSourceContractTest.TestResource.Builder setUri(Uri uri)

Sets the URI where this resource should be requested from.