Interface E2ETestHelperMixin
-
public interface E2ETestHelperMixinUtility methods for writing E2E tests.See
FormcycleFormBrowserHelperfor helper methods related to interacting with forms opened in a browser.- Since:
- 8.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
FormcycleFormBrowserHelper
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidassertConformingHtml(de.xima.e2e.test_harness_selenium.bot.api.ISeleniumBot bot, de.xima.nu_validator.wrapper.bridge.api.INuValidator validator, Consumer<de.xima.nu_validator.wrapper.common.api.INuValidatorOptionsBuilder> configurator)Gets the HTML from the currently open page, and asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.default voidassertConformingHtml(de.xima.e2e.test_harness_selenium.bot.api.ISeleniumBot bot, Consumer<de.xima.nu_validator.wrapper.common.api.INuValidatorOptionsBuilder> configurator)Gets the HTML from the currently open page, and asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.default voidassertConformingHtml(String html)Asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.default voidassertConformingHtml(String html, de.xima.nu_validator.wrapper.bridge.api.INuValidator validator, Consumer<de.xima.nu_validator.wrapper.common.api.INuValidatorOptionsBuilder> configurator)Asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.default voidassertConformingHtml(String html, Consumer<de.xima.nu_validator.wrapper.common.api.INuValidatorOptionsBuilder> configurator)Asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.default voidassertConformingHtml(org.openqa.selenium.WebDriver driver, de.xima.nu_validator.wrapper.bridge.api.INuValidator validator, Consumer<de.xima.nu_validator.wrapper.common.api.INuValidatorOptionsBuilder> configurator)Gets the HTML from the currently open page, and asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.default voidassertConformingHtml(org.openqa.selenium.WebDriver driver, Consumer<de.xima.nu_validator.wrapper.common.api.INuValidatorOptionsBuilder> configurator)Gets the HTML from the currently open page, and asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.default voidassertContains(Object expectedItem, Iterable<?> actualItems)Asserts that the given items contain the expected item.default voidassertContains(String expectedSubstring, String actualText)Asserts that the given text contains the expected substring.default voidassertMimeTypeEquals(String expected, String actual)Asserts that the expected mime type equals the actual mime type.default voidassertMimeTypeEquals(String expected, HttpResponse<?> actual)Asserts that the expected mime type equals the mime type of the given response.default Stringchecksum(MessageDigest digest, com.codeborne.selenide.SelenideElement element)Downloads the file from the element and returns its checksum.default Stringchecksum(MessageDigest digest, File file)default Stringchecksum(MessageDigest digest, InputStream in)default Stringchecksum(MessageDigest digest, Path file)default IFormcycleAppStatecreateClientWithPluginAndForms(IFormcycleProvisioner provisioner, String... forms)Creates a new client, installs the plugin, and imports all given forms.default IFormcycleAppStatecreateClientWithPluginAndForms(IFormcycleProvisioner provisioner, URI jarUri, URI... forms)Creates a new client, installs the plugin, and imports all given forms.default IFormcycleAppStatecreateClientWithPluginAndForms(IFormcycleProvisioner provisioner, URI jarUri, Properties pluginProperties, URI... forms)Creates a new client, installs the plugin, and imports all given forms.default IFormcycleAppStatecreateClientWithPluginAndForms(IFormcycleProvisioner provisioner, Properties pluginProperties, String... forms)Creates a new client, installs the plugin, and imports all given forms.default HttpResponse<byte[]>fetchUriAsBinary(URI uri)Similar toreadUriAsBinary(URI), but uses the native HTTP client to read the contents of the URI via aGETrequest.default HttpResponse<byte[]>fetchUriAsBinaryFollowingRedirects(URI uri)Similar toreadUriAsBinary(URI), but uses the native HTTP client to read the contents of the URI via aGETrequest.default HttpResponse<String>fetchUriAsText(URI uri)Similar toreadUriAsText(URI, Charset), but uses the native HTTP client to read the contents of the URI via aGETrequest.default HttpResponse<String>fetchUriAsText(URI uri, Charset charset)Similar toreadUriAsText(URI, Charset), but uses the native HTTP client to read the contents of the URI via aGETrequest.default HttpResponse<String>fetchUriAsTextFollowingRedirects(URI uri, Charset charset)Similar toreadUriAsText(URI, Charset), but uses the native HTTP client to read the contents of the URI via aGETrequest.default URIgetClasspathResourceAsUri(String path)Gets the URI for a given class path resource, using the currentloadingClass().default Class<?>loadingClass()Gets the class to use for loading resources.default MessageDigestmd5()default InputStreamopenClasspathResource(String path)Opens an input stream to a class path resource, using theloadingClass().default InputStreamopenUri(URI uri)Opens an input stream to the given URI.default <T> HttpResponse<T>postFormEncodedData(URI uri, Map<String,Object> bodyData, HttpResponse.BodyHandler<T> handler)default byte[]readClasspathResourceAsBinary(String path)Reads a class path resource and returns the binary content of the resource.default StringreadClasspathResourceAsText(String path)Reads a class path resource and returns the text content of the resource.default StringreadClasspathResourceAsText(String path, Charset charset)Reads a class path resource and returns the text content of the resource.default StringreadPageSourceViaScript(org.openqa.selenium.WebDriver driver)Reads the source HTML of the currently active browsing window via JavaScript.default byte[]readUriAsBinary(URI uri)Reads the data of a URI and returns its contents as a byte array.default StringreadUriAsText(URI uri)Reads the data of a URI and returns its contents as a string, using theUTF_8charset to decode the binary data.default StringreadUriAsText(URI uri, Charset charset)Reads the data of a URI and returns its contents as a string, using the given charset to decode the binary data.default MessageDigestsha256()default URItoUri(String uri)Converts a URI to a URL.default URItoUri(URL url)Converts a URL to a URI.default StringurlEncode(Iterable<? extends Map.Entry<String,?>> data)Encodes the given data as a string according to theapplication/x-www-form-urlencodedformat.default StringurlEncode(Map<String,?> data)Encodes the given data as a string according to theapplication/x-www-form-urlencodedformat.
-
-
-
Method Detail
-
assertConformingHtml
default void assertConformingHtml(String html) throws de.xima.nu_validator.wrapper.bridge.api.NuValidatorException
Asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.- Parameters:
html- The HTML to validate.- Throws:
de.xima.nu_validator.wrapper.bridge.api.NuValidatorException- When the HTML could not be validated.
-
assertConformingHtml
default void assertConformingHtml(String html, Consumer<de.xima.nu_validator.wrapper.common.api.INuValidatorOptionsBuilder> configurator) throws de.xima.nu_validator.wrapper.bridge.api.NuValidatorException
Asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.- Parameters:
html- The HTML to validate.configurator- Configurator for the options to use for validation.- Throws:
de.xima.nu_validator.wrapper.bridge.api.NuValidatorException- When the HTML could not be validated.
-
assertConformingHtml
default void assertConformingHtml(String html, de.xima.nu_validator.wrapper.bridge.api.INuValidator validator, Consumer<de.xima.nu_validator.wrapper.common.api.INuValidatorOptionsBuilder> configurator) throws de.xima.nu_validator.wrapper.bridge.api.NuValidatorException
Asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.- Parameters:
html- The HTML to validate.validator- Validator to use for validation.configurator- Configurator for the options to use for validation.- Throws:
de.xima.nu_validator.wrapper.bridge.api.NuValidatorException- When the HTML could not be validated.
-
assertConformingHtml
default void assertConformingHtml(org.openqa.selenium.WebDriver driver, Consumer<de.xima.nu_validator.wrapper.common.api.INuValidatorOptionsBuilder> configurator) throws de.xima.nu_validator.wrapper.bridge.api.NuValidatorExceptionGets the HTML from the currently open page, and asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.- Parameters:
driver- The driver to use for getting the HTML.configurator- Configurator for the options to use for validation.- Throws:
de.xima.nu_validator.wrapper.bridge.api.NuValidatorException- When the HTML could not be validated.
-
assertConformingHtml
default void assertConformingHtml(org.openqa.selenium.WebDriver driver, de.xima.nu_validator.wrapper.bridge.api.INuValidator validator, Consumer<de.xima.nu_validator.wrapper.common.api.INuValidatorOptionsBuilder> configurator) throws de.xima.nu_validator.wrapper.bridge.api.NuValidatorExceptionGets the HTML from the currently open page, and asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.- Parameters:
driver- The driver to use for getting the HTML.validator- Validator to use for validation.configurator- Configurator for the options to use for validation.- Throws:
de.xima.nu_validator.wrapper.bridge.api.NuValidatorException- When the HTML could not be validated.
-
assertConformingHtml
default void assertConformingHtml(de.xima.e2e.test_harness_selenium.bot.api.ISeleniumBot bot, Consumer<de.xima.nu_validator.wrapper.common.api.INuValidatorOptionsBuilder> configurator) throws de.xima.nu_validator.wrapper.bridge.api.NuValidatorExceptionGets the HTML from the currently open page, and asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.- Parameters:
bot- The browser bot to use for getting the HTML.configurator- Configurator for the options to use for validation.- Throws:
de.xima.nu_validator.wrapper.bridge.api.NuValidatorException- When the HTML could not be validated.
-
assertConformingHtml
default void assertConformingHtml(de.xima.e2e.test_harness_selenium.bot.api.ISeleniumBot bot, de.xima.nu_validator.wrapper.bridge.api.INuValidator validator, Consumer<de.xima.nu_validator.wrapper.common.api.INuValidatorOptionsBuilder> configurator) throws de.xima.nu_validator.wrapper.bridge.api.NuValidatorExceptionGets the HTML from the currently open page, and asserts the given HTML is W3C conform, without any errors, warnings or fatal errors.- Parameters:
bot- The browser bot to use for getting the HTML.validator- Validator to use for validation.configurator- Configurator for the options to use for validation.- Throws:
de.xima.nu_validator.wrapper.bridge.api.NuValidatorException- When the HTML could not be validated.
-
assertContains
default void assertContains(Object expectedItem, Iterable<?> actualItems)
Asserts that the given items contain the expected item.- Parameters:
expectedItem- Expected item.actualItems- Actual items.
-
assertContains
default void assertContains(String expectedSubstring, String actualText)
Asserts that the given text contains the expected substring.- Parameters:
expectedSubstring- Expected substring.actualText- Actual text content.
-
assertMimeTypeEquals
default void assertMimeTypeEquals(String expected, HttpResponse<?> actual) throws javax.activation.MimeTypeParseException
Asserts that the expected mime type equals the mime type of the given response.This method parses the MIME type and compares its parts. This ensures that formatting differences such as
text/plain; charset=utf8; foo=barvstext/plain;foo=bar;charset=utf8do not affect the assertion.- Parameters:
expected- Expected MIME type.actual- Actual MIME type.- Throws:
javax.activation.MimeTypeParseException- When the given strings do not conform to the MIME type format.
-
assertMimeTypeEquals
default void assertMimeTypeEquals(String expected, String actual) throws javax.activation.MimeTypeParseException
Asserts that the expected mime type equals the actual mime type.This method parses the MIME type and compares its parts. This ensures that formatting differences such as
text/plain; charset=utf8; foo=barvstext/plain;foo=bar;charset=utf8do not affect the assertion.- Parameters:
expected- Expected MIME type.actual- Actual MIME type.- Throws:
javax.activation.MimeTypeParseException- When the given strings do not conform to the MIME type format.
-
checksum
default String checksum(MessageDigest digest, Path file) throws FileNotFoundException, IOException
- Parameters:
digest- Checksum algorithm to use.file- File to read.- Returns:
- The checksum of the data from the file.
- Throws:
FileNotFoundException- When the given file does not exist.IOException- When the file could not be read.
-
checksum
default String checksum(MessageDigest digest, File file) throws FileNotFoundException, IOException
- Parameters:
digest- Checksum algorithm to use.file- File to read.- Returns:
- The checksum of the data from the file.
- Throws:
FileNotFoundException- When the given file does not exist.IOException- When the file could not be read.
-
checksum
default String checksum(MessageDigest digest, InputStream in) throws IOException
- Parameters:
digest- Checksum algorithm to use.in- Input stream to read.- Returns:
- The checksum of the data from the input stream.
- Throws:
IOException- When the input stream could not be read.
-
checksum
default String checksum(MessageDigest digest, com.codeborne.selenide.SelenideElement element) throws FileNotFoundException, IOException
Downloads the file from the element and returns its checksum.- Parameters:
digest- Checksum algorithm to use.element- Element with a download.- Returns:
- The checksum of the file from the element.
- Throws:
FileNotFoundException- When the element does not have a file to download.IOException- When the file could not be downloaded.
-
createClientWithPluginAndForms
default IFormcycleAppState createClientWithPluginAndForms(IFormcycleProvisioner provisioner, String... forms) throws Exception
Creates a new client, installs the plugin, and imports all given forms. This method assumes that you follow the standard conventions as outlined below, usecreateClientWithPluginAndForms(IFormcycleProvisioner, URI, URI...)if you do not do so.All forms must have a file name that ends on
.xfp, and must be placed in a folder nameforms, and must be available as a class path resource. Usually that means you should create files likesrc/test/resources/forms/some-form.xfp src/test/resources/forms/another-form.xfp
You must set a system property namedplugin.paththat contains the path to the plugin JAR. Optionally, you can also set a system property namedplugin.propertieswith the path to the properties file containing the configuration for the plugin. Usually you would do this within the failsafe-maven-plugin section of the Maven pom like this:<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>${maven-failsafe-plugin.version}</version> <executions> <execution> <id>default-e2e-test</id> <goals> <goal>integration-test</goal> </goals> <configuration> <systemPropertyVariables> <plugin.path>${project.build.directory}/${project.artifactId}.jar</plugin.path> <plugin.properties>${project.basedir}/src/test/resources/plugin-test.properties</plugin.properties> </systemPropertyVariables> </configuration> </execution> </executions> </plugin>- Parameters:
provisioner- Provisioner to use for performing the setup actions.forms- List of forms to install. Must- Returns:
- The result of the setup actions. Includes the ID of the created client.
- Throws:
Exception- When the setup actions could not be performed.
-
createClientWithPluginAndForms
default IFormcycleAppState createClientWithPluginAndForms(IFormcycleProvisioner provisioner, Properties pluginProperties, String... forms) throws Exception
Creates a new client, installs the plugin, and imports all given forms. This method assumes that you follow the standard conventions as outlined below, usecreateClientWithPluginAndForms(IFormcycleProvisioner, URI, URI...)if you do not do so.All forms must have a file name that ends on
.xfp, and must be placed in a folder nameforms, and must be available as a class path resource. Usually that means you should create files likesrc/test/resources/forms/some-form.xfp src/test/resources/forms/another-form.xfp
You must set a system property namedplugin.paththat contains the path to the plugin JAR. Optionally, you can also set a system property namedplugin.propertieswith the path to the properties file containing the configuration for the plugin. Usually you would do this within the failsafe-maven-plugin section of the Maven pom like this:<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>${maven-failsafe-plugin.version}</version> <executions> <execution> <id>default-e2e-test</id> <goals> <goal>integration-test</goal> </goals> <configuration> <systemPropertyVariables> <plugin.path>${project.build.directory}/${project.artifactId}.jar</plugin.path> <plugin.properties>${project.basedir}/src/test/resources/plugin-test.properties</plugin.properties> </systemPropertyVariables> </configuration> </execution> </executions> </plugin>- Parameters:
provisioner- Provisioner to use for performing the setup actions.pluginProperties- Optional properties with the configuration for the plugin. These are applied on top of the properties from the system propertyplugin.properties.forms- List of forms to install.- Returns:
- The result of the setup actions. Includes the ID of the created client.
- Throws:
Exception- When the setup actions could not be performed.
-
createClientWithPluginAndForms
default IFormcycleAppState createClientWithPluginAndForms(IFormcycleProvisioner provisioner, URI jarUri, URI... forms) throws Exception
Creates a new client, installs the plugin, and imports all given forms.You must set a system property that contains the path t
- Parameters:
provisioner- Provisioner to use for performing the setup actions.jarUri- URI with the plugin to install.forms- List of URIs with the forms to import.- Returns:
- The result of the setup actions. Includes the ID of the created client.
- Throws:
Exception- When the setup actions could not be performed.
-
createClientWithPluginAndForms
default IFormcycleAppState createClientWithPluginAndForms(IFormcycleProvisioner provisioner, URI jarUri, Properties pluginProperties, URI... forms) throws Exception
Creates a new client, installs the plugin, and imports all given forms.You must set a system property that contains the path t
- Parameters:
provisioner- Provisioner to use for performing the setup actions.jarUri- URI with the plugin to install.pluginProperties- Optional properties with the configuration for the plugin.forms- List of URIs with the forms to import.- Returns:
- The result of the setup actions. Includes the ID of the created client.
- Throws:
Exception- When the setup actions could not be performed.
-
fetchUriAsBinary
default HttpResponse<byte[]> fetchUriAsBinary(URI uri) throws IOException, InterruptedException
Similar toreadUriAsBinary(URI), but uses the native HTTP client to read the contents of the URI via aGETrequest. Redirect are not followed.- Parameters:
uri- URI to read.- Returns:
- The body of the HTTP response.
- Throws:
IOException- When the URI could not be accessed.InterruptedException- When this thread was interrupted while waiting for the response to the HTTP request.
-
fetchUriAsBinaryFollowingRedirects
default HttpResponse<byte[]> fetchUriAsBinaryFollowingRedirects(URI uri) throws IOException, InterruptedException
Similar toreadUriAsBinary(URI), but uses the native HTTP client to read the contents of the URI via aGETrequest. Redirect are followed.- Parameters:
uri- URI to read.- Returns:
- The body of the HTTP response.
- Throws:
IOException- When the URI could not be accessed.InterruptedException- When this thread was interrupted while waiting for the response to the HTTP request.
-
fetchUriAsText
default HttpResponse<String> fetchUriAsText(URI uri) throws IOException, InterruptedException
Similar toreadUriAsText(URI, Charset), but uses the native HTTP client to read the contents of the URI via aGETrequest. Uses theUTF_8encoding to decode the data into a string. Redirects are not followed.- Parameters:
uri- URI to read.- Returns:
- The body of the HTTP response, read as a string with the given encoding.
- Throws:
IOException- When the URI could not be accessed.InterruptedException- When this thread was interrupted while waiting for the response to the HTTP request.
-
fetchUriAsText
default HttpResponse<String> fetchUriAsText(URI uri, Charset charset) throws IOException, InterruptedException
Similar toreadUriAsText(URI, Charset), but uses the native HTTP client to read the contents of the URI via aGETrequest. Redirects are not followed.- Parameters:
uri- URI to read.charset- Charset to use for decoding the data to a string.- Returns:
- The body of the HTTP response, read as a string with the given encoding.
- Throws:
IOException- When the URI could not be accessed.InterruptedException- When this thread was interrupted while waiting for the response to the HTTP request.
-
fetchUriAsTextFollowingRedirects
default HttpResponse<String> fetchUriAsTextFollowingRedirects(URI uri, Charset charset) throws IOException, InterruptedException
Similar toreadUriAsText(URI, Charset), but uses the native HTTP client to read the contents of the URI via aGETrequest. Redirects are followed.- Parameters:
uri- URI to read.charset- Charset to use for decoding the data to a string.- Returns:
- The body of the HTTP response, read as a string with the given encoding.
- Throws:
IOException- When the URI could not be accessed.InterruptedException- When this thread was interrupted while waiting for the response to the HTTP request.
-
getClasspathResourceAsUri
default URI getClasspathResourceAsUri(String path) throws IllegalArgumentException
Gets the URI for a given class path resource, using the currentloadingClass().- Parameters:
path- (Absolute) path of the class path resource.- Returns:
- A URI pointing to the class path resource.
- Throws:
IllegalArgumentException- When the resource was not found.
-
loadingClass
default Class<?> loadingClass()
Gets the class to use for loading resources. Defaults tothis class.- Returns:
- Class to use for loading resources.
-
md5
default MessageDigest md5()
- Returns:
- The MD5 checksum algorithm.
-
openClasspathResource
default InputStream openClasspathResource(String path) throws IOException
Opens an input stream to a class path resource, using theloadingClass().- Parameters:
path- (Absolute) path of a class path resource.- Returns:
- An input stream with the data of the given class path resource.
- Throws:
IOException- When the input stream could not be opened; or when the resource does not exist.
-
openUri
default InputStream openUri(URI uri) throws MalformedURLException, IOException
Opens an input stream to the given URI.- Parameters:
uri- URI to open.- Returns:
- An input stream with the data of the given URI.
- Throws:
MalformedURLException- When the URI could not be converted into a URL.IOException- When the stream could not be opened.
-
postFormEncodedData
default <T> HttpResponse<T> postFormEncodedData(URI uri, Map<String,Object> bodyData, HttpResponse.BodyHandler<T> handler) throws IOException, InterruptedException
- Parameters:
uri- URI to which to post.bodyData- Form data to send with the request.handler- Converter for the response.- Returns:
- The HTTP response from the post request.
- Throws:
IOException- When the URI could not be accessed.InterruptedException- When this thread was interrupted while reading the resource.
-
readClasspathResourceAsBinary
default byte[] readClasspathResourceAsBinary(String path) throws IOException
Reads a class path resource and returns the binary content of the resource.- Parameters:
path- (Absolute) path of a class path resource.- Returns:
- The contents of the resource.
- Throws:
IOException- When the resource could not be opened or was not found.
-
readClasspathResourceAsText
default String readClasspathResourceAsText(String path, Charset charset) throws IOException
Reads a class path resource and returns the text content of the resource.- Parameters:
path- (Absolute) path of a class path resource.charset- Charset to use for reading the resource.- Returns:
- The contents of the resource.
- Throws:
IOException- When the resource could not be opened or was not found.
-
readClasspathResourceAsText
default String readClasspathResourceAsText(String path) throws IOException
Reads a class path resource and returns the text content of the resource. Uses theUTF_8encoding.- Parameters:
path- (Absolute) path of a class path resource.- Returns:
- The contents of the resource.
- Throws:
IOException- When the resource could not be opened or was not found.
-
readPageSourceViaScript
default String readPageSourceViaScript(org.openqa.selenium.WebDriver driver)
Reads the source HTML of the currently active browsing window via JavaScript.- Parameters:
driver- WebDriver to use for reading the source.- Returns:
- The source of the currently active browsing window.
-
readUriAsBinary
default byte[] readUriAsBinary(URI uri) throws IOException
Reads the data of a URI and returns its contents as a byte array.- Parameters:
uri- URI to read.- Returns:
- The contents of the resource pointed to by the URI.
- Throws:
IOException- When the URI could not be read.
-
readUriAsText
default String readUriAsText(URI uri, Charset charset) throws IOException
Reads the data of a URI and returns its contents as a string, using the given charset to decode the binary data.- Parameters:
uri- URI to read.charset- Charset to use for decoding the text content.- Returns:
- The contents of the resource pointed to by the URI.
- Throws:
IOException- When the URI could not be read.
-
readUriAsText
default String readUriAsText(URI uri) throws IOException
Reads the data of a URI and returns its contents as a string, using theUTF_8charset to decode the binary data.- Parameters:
uri- URI to read.- Returns:
- The contents of the resource pointed to by the URI.
- Throws:
IOException- When the URI could not be read.
-
sha256
default MessageDigest sha256()
- Returns:
- The SHA-256 checksum algorithm.
-
toUri
default URI toUri(String uri) throws URISyntaxException
Converts a URI to a URL.- Parameters:
uri- URI to convert.- Returns:
- The converted URL.
- Throws:
URISyntaxException- When the URI could not be converted to a URL.
-
toUri
default URI toUri(URL url) throws URISyntaxException
Converts a URL to a URI.- Parameters:
url- The URL to convert.- Returns:
- The converted URI.
- Throws:
URISyntaxException- When the URL could not be converted.
-
urlEncode
default String urlEncode(Iterable<? extends Map.Entry<String,?>> data)
Encodes the given data as a string according to theapplication/x-www-form-urlencodedformat.- Parameters:
data- Data map to convert.- Returns:
- A
application/x-www-form-urlencodedencoded string with the data.
-
-