Class TestResourceNamer

    • Constructor Detail

      • TestResourceNamer

        public TestResourceNamer​(TestContextManager testContextManager,
                                 RecordedData recordedData)
        Constructor of TestResourceNamer
        Parameters:
        testContextManager - Contextual information about the test being ran, such as test name, TestMode, and others.
        recordedData - the recorded data with list of network call
        Throws:
        java.lang.NullPointerException - If testMode isn't TestMode.LIVE, doNotRecord is false, and recordedData is null.
    • Method Detail

      • randomName

        public java.lang.String randomName​(java.lang.String prefix,
                                           int maxLen)
        Gets a random name.
        Overrides:
        randomName in class ResourceNamer
        Parameters:
        prefix - the prefix to be used if possible
        maxLen - the max length for the random generated name
        Returns:
        the random name
      • randomUuid

        public java.lang.String randomUuid()
        Gets a random UUID.
        Overrides:
        randomUuid in class ResourceNamer
        Returns:
        A random UUID.
      • now

        public org.threeten.bp.OffsetDateTime now()
        Gets an OffsetDateTime of UTC now.
        Returns:
        OffsetDateTime of UTC now.
      • recordValueFromConfig

        public java.lang.String recordValueFromConfig​(java.lang.String value)
        Record the value into recordedData, and pop it up when playback.
        Parameters:
        value - the value needs to record.
        Returns:
        the recorded value.