public class Util extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkContentDisposition(org.apache.sling.testing.clients.SlingHttpResponse response,
String expected)
Check if the content disposition header of the response is equal to the given value
|
static void |
checkContentLength(org.apache.sling.testing.clients.SlingHttpResponse response,
long expected)
Check if the content length of the response is equal to the given value
|
static com.fasterxml.jackson.databind.JsonNode |
getJsonChildNode(com.fasterxml.jackson.databind.JsonNode parent,
String... children)
Retrieve a child node
|
static long |
getJsonLongValue(com.fasterxml.jackson.databind.JsonNode parent,
String fieldName)
Retrieve the long value of a field
|
static long |
getResourceSize(String resourcePath)
Retrieve the size of a resource.
|
public static long getResourceSize(String resourcePath) throws org.apache.sling.testing.clients.ClientException
resourcePath - Path to the resource available to the class loaderorg.apache.sling.testing.clients.ClientException - Thrown if the size of the resource can't be calculatedpublic static void checkContentLength(org.apache.sling.testing.clients.SlingHttpResponse response,
long expected)
throws org.apache.sling.testing.clients.ClientException
response - HTTP responseexpected - Expected content lengthorg.apache.sling.testing.clients.ClientException - Thrown if the content-length of the HTTP response doesn't match expectedpublic static void checkContentDisposition(org.apache.sling.testing.clients.SlingHttpResponse response,
String expected)
throws org.apache.sling.testing.clients.ClientException
response - HTTP responseexpected - Expected content dispositionorg.apache.sling.testing.clients.ClientException - Thrown if the content-disposition of the HTTP response doesn't match expectedpublic static com.fasterxml.jackson.databind.JsonNode getJsonChildNode(com.fasterxml.jackson.databind.JsonNode parent,
String... children)
parent - Parent nodechildren - Each child goes down one level, e.g. (root, a, b) will go to root/a/bpublic static long getJsonLongValue(com.fasterxml.jackson.databind.JsonNode parent,
String fieldName)
parent - Parent nodefieldName - Field to retrieveCopyright © 2022. All rights reserved.