Package ca.cdr.test.util
Class UrlPathUtil
java.lang.Object
ca.cdr.test.util.UrlPathUtil
Helpers for the URL paths under which Smile CDR modules are served.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringnormalizeContextPath(String theContextPath) Normalizes a module'scontext_pathso that it can be appended to aprotocol://host:portroot as-is.static StringwithTrailingSlash(String theBaseUrl) Spring'sRestClientappends a request's URI template to the base URL's path verbatim, so a base URL with a context path and no trailing slash turnsmodule-config/into/admin-jsonmodule-config/.
-
Method Details
-
normalizeContextPath
Normalizes a module'scontext_pathso that it can be appended to aprotocol://host:portroot as-is.- Parameters:
theContextPath- the configured context path; null, blank and/all mean the root- Returns:
- the empty string for the root, otherwise the path with one leading slash and no
trailing slash, such as
/fhir-request
-
withTrailingSlash
Spring'sRestClientappends a request's URI template to the base URL's path verbatim, so a base URL with a context path and no trailing slash turnsmodule-config/into/admin-jsonmodule-config/. With the trailing slash, bothmodule-config/and/module-config/resolve beneath the context path.- Parameters:
theBaseUrl- a base URL, with or without a trailing slash- Returns:
- the same URL ending in exactly one slash
-