Class ResourceTestUtils


  • public class ResourceTestUtils
    extends Object
    Test utils around module resources.
    • Constructor Detail

      • ResourceTestUtils

        public ResourceTestUtils()
    • Method Detail

      • getResource

        public static Path getResource​(String resourceNameRegex)
        Searches for a resource file matching the given regex in the given directory. This method is primarily intended to be used for the initialization of static Path fields for resource file(i.e. jar, config file) that reside in the modules target directory.
        Parameters:
        resourceNameRegex - regex pattern to match against
        Returns:
        Path pointing to the matching jar
        Throws:
        RuntimeException - if none or multiple resource files could be found