public class PackagingTestUtils extends Object
| Constructor and Description |
|---|
PackagingTestUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertJarContainsOnlyFilesMatching(Path jarPath,
Collection<String> allowedPaths)
Verifies that all files in the jar match one of the provided allow strings.
|
static void |
assertJarContainsServiceEntry(Path jarPath,
Class<?> service)
Verifies that the given jar contains a service entry file for the given service.
|
public static void assertJarContainsOnlyFilesMatching(Path jarPath, Collection<String> allowedPaths) throws Exception
An allow item ending on a "/" is treated as an allowed parent directory.
Otherwise, it is treated as an allowed file.
For example, given a jar containing a file META-INF/NOTICES:
These would pass:
"META-INF/"
"META-INF/NOTICES"
These would fail:
"META-INF"
"META-INF/NOTICE"
"META-INF/NOTICES/"
Exceptionpublic static void assertJarContainsServiceEntry(Path jarPath, Class<?> service) throws Exception
Caution: This only checks that the file exists; the content is not verified.
ExceptionCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.