public RunResult run() throws IOException {
            if (outConfig == null) {
                throw new IllegalStateException("out config must be set");
            }
            if (inputPath == null) {
                throw new IllegalStateException("inputPath must be set");
            }

            String fileName = inputPath.toAbsolutePath().toString();
            if (!fileName.endsWith(".csv")) {
                throw new IllegalArgumentException("inputPath must end with .csv");
            }

            // exec: config
            execConfig.set("min_output_tasks", 1);

            // in: config
            ConfigSource inConfig = newConfig()
                    .set("type", "file")
                    .set("path_prefix", fileName)
                    .set("parser", newParserConfig());

            // config = {exec: execConfig, in: inConfig, out: outConfig}
            ConfigSource config = newConfig()
                    .set("exec", execConfig)
                    .set("in", inConfig)
                    .set("out", outConfig);

            // embed.run returns TestingBulkLoader.TestingExecutionResult because
            // LoaderState.buildExecuteResultWithWarningException is overridden.
            return (RunResult) embed.run(config);
        }
This method returns PreviewResult.

@return PreviewResult returns the result by PreviewExecutor
@throws IOException in case of failures in file operations
embulk-junit4/src/main/java/org/embulk/test/TestingEmbulk.java