@Test
    public void testLoadPluginClassForFlatJar() throws Exception {
        final Path pluginJarPath = BUILT_JARS_DIR.resolve("embulk-test-maven-plugin-flat.jar");
        final Path dependencyJarPath = BUILT_JARS_DIR.resolve("embulk-test-maven-plugin-deps.jar");

        final ArrayList<Path> dependencyJarPaths = new ArrayList<>();
        dependencyJarPaths.add(dependencyJarPath);

        final Class<?> loadedClass;
        try (final JarPluginLoader loader = JarPluginLoader.load(
                 pluginJarPath,
                 Collections.unmodifiableList(dependencyJarPaths),
                 EmbulkTestRuntime.buildPluginClassLoaderFactory())) {
            assertEquals(0, loader.getPluginSpiVersion());
            loadedClass = loader.getPluginMainClass();
        }

        final ClassLoader classLoader = loadedClass.getClassLoader();
        assertTrue(classLoader instanceof PluginClassLoader);

        verifyMainClass(loadedClass);

        assertEquals("Hello", readResource(classLoader, "embulk-test-maven-plugin/main.txt"));
        assertEquals("World", readResource(classLoader, "embulk-test-maven-plugin/deps.txt"));
    }
Test cases in this class depend on JARs built by "test-helpers" project.

See "deployJarsForEmbulkTestMavenPlugin" task in test-helpers/build.gradle for more details
embulk-core/src/test/java/org/embulk/plugin/jar/TestJarPluginLoader.java