public IHalClient
Interface to a HAL Client
@NotNull IHalClient navigate()
Navigates to the Root
@NotNull IHalClient navigate(@NotNull java.util.Map<java.lang.String,? extends java.lang.Object> options, @NotNull java.lang.String link)
Navigates the URL associated with the given link using the current HAL document
options - Map of key-value pairs to use for parsing templated linkslink - Link name to navigate@NotNull IHalClient navigate(@NotNull java.lang.String link)
Navigates the URL associated with the given link using the current HAL document
link - Link name to navigate@Nullable
java.lang.String linkUrl(@NotNull
java.lang.String name)
Returns the HREF of the named link from the current HAL document
void forAll(@NotNull
java.lang.String linkName,
@NotNull
java.util.function.Consumer<java.util.Map> closure)
Calls the closure with a Map of attributes for all links associated with the link name
linkName - Name of the link to loop overclosure - Closure to invoke with the link attributes@NotNull
com.github.michaelbull.result.Result<java.lang.Boolean,java.lang.Exception> postJson(@NotNull
java.lang.String url,
@NotNull
java.lang.String body)
Upload the JSON document to the provided URL, using a POST request
url - Url to upload the document tobody - JSON contents for the body@NotNull
com.github.michaelbull.result.Result<java.lang.Boolean,java.lang.Exception> postJson(@NotNull
java.lang.String url,
@NotNull
java.lang.String body,
@Nullable
kotlin.jvm.functions.Function2<? super java.lang.Integer,? super org.apache.http.client.methods.CloseableHttpResponse,java.lang.Boolean> handler)
Upload the JSON document to the provided URL, using a POST request
url - Url to upload the document tobody - JSON contents for the bodyhandler - Response handler@NotNull
com.github.michaelbull.result.Result<au.com.dius.pact.core.support.json.JsonValue.Object,java.lang.Exception> fetch(@NotNull
java.lang.String path,
boolean encodePath)
Fetches the HAL document from the provided path
path - The path to the HAL document. If it is a relative path, it is relative to the base URLencodePath - If the path should be encoded to make a valid URL@NotNull
com.github.michaelbull.result.Result<au.com.dius.pact.core.support.json.JsonValue.Object,java.lang.Exception> fetch(@NotNull
java.lang.String path)
Fetches the HAL document from the provided path
path - The path to the HAL document. If it is a relative path, it is relative to the base URL@NotNull IHalClient withDocContext(@NotNull java.util.Map<java.lang.String,? extends java.lang.Object> docAttributes)
Sets the starting context from a previous broker interaction (Pact document)
@NotNull IHalClient withDocContext(@NotNull au.com.dius.pact.core.support.json.JsonValue.Object docAttributes)
Sets the starting context from a previous broker interaction (Pact document)
@NotNull
com.github.michaelbull.result.Result<java.lang.String,java.lang.Exception> putJson(@NotNull
java.lang.String link,
@NotNull
java.util.Map<java.lang.String,? extends java.lang.Object> options,
@NotNull
java.lang.String json)
Upload a JSON document to the current path link, using a PUT request
@NotNull
com.github.michaelbull.result.Result<au.com.dius.pact.core.support.json.JsonValue.Object,java.lang.Exception> postJson(@NotNull
java.lang.String link,
@NotNull
java.util.Map<java.lang.String,? extends java.lang.Object> options,
@NotNull
java.lang.String json)
Upload a JSON document to the current path link, using a POST request
@NotNull
com.github.michaelbull.result.Result<au.com.dius.pact.core.support.json.JsonValue,java.lang.Exception> getJson(@NotNull
java.lang.String path)
Get JSON from the provided path
@NotNull
com.github.michaelbull.result.Result<au.com.dius.pact.core.support.json.JsonValue,java.lang.Exception> getJson(@NotNull
java.lang.String path,
boolean encodePath)
Get JSON from the provided path
path - Path to fetch the JSON document fromencodePath - If the path should be encoded