Class EMTestUtils


  • public class EMTestUtils
    extends Object
    Class containing utility functions that can be used in the automatically generated tests
    • Constructor Detail

      • EMTestUtils

        public EMTestUtils()
    • Method Detail

      • resolveLocation

        public static String resolveLocation​(String locationHeader,
                                             String expectedTemplate)
        Parameters:
        locationHeader - a URI-reference, coming from a "location" header. See RFC 7231. Note: it can be a relative reference
        expectedTemplate - a full URI of the target resource, but with some path elements that might (or might not) be unresolved. If locationHeader is not empty, it will replace the beginning of this template.
        Returns:
        a fully resolved URI for the target resource. If there are problems, just return the input locationHeader. If this latter is empty/null, then return the template
      • isValidURIorEmpty

        public static boolean isValidURIorEmpty​(String uri)
        Parameters:
        uri - a string representing a URI
        Returns:
        whether the given input string is either empty or a valid URI