// Path: src/test/java/com/github/mjeanroy/maven/plugins/node/tests/FileTestUtils.java
// public static File join(File root, String path, String... others) {
// 	File out = new File(root, path);
// 	for (String other : others) {
// 		out = new File(out, other);
// 	}
// 
// 	return out;
// }
// 
// Path: src/test/java/com/github/mjeanroy/maven/plugins/node/tests/ReflectTestUtils.java
// @SuppressWarnings("unchecked")
// public static <T> T readPrivate(Object instance, String name) {
// 	try {
// 		return (T) readField(instance, name, true);
// 	}
// 	catch (Exception ex) {
// 		throw new AssertionError(ex);
// 	}
// }
// 
// Path: src/test/java/com/github/mjeanroy/maven/plugins/node/tests/ReflectTestUtils.java
// public static <T> void writePrivate(Object instance, String name, T value) {
// 	try {
// 		writeField(instance, name, value, true);
// 	}
// 	catch (Exception ex) {
// 		throw new AssertionError(ex);
// 	}
// }


import static com.github.mjeanroy.maven.plugins.node.tests.ReflectTestUtils.writePrivate;
import static java.util.Arrays.asList;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import org.apache.maven.plugin.logging.Log;
import org.junit.Test;
import java.io.File;
import static com.github.mjeanroy.maven.plugins.node.tests.FileTestUtils.join;
import static com.github.mjeanroy.maven.plugins.node.tests.ReflectTestUtils.readPrivate;
/**
 * The MIT License (MIT)
 *
 * Copyright (c) 2015-2021 Mickael Jeanroy
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.github.mjeanroy.maven.plugins.node.mojos;




public class BuildMojoTest extends AbstractNpmScriptIncrementalMojoTest<BuildMojo> {

	@Override
	String mojoName() {
		return "build";
	}

	@Override
	String scriptParameterName() {
		return "buildScript";
	}

	@Override
	void enableSkip(BuildMojo mojo) {
		writePrivate(mojo, "skipBuild", true);
	}

	@Test
	public void it_should_write_input_state_after_build() throws Exception {
		BuildMojo mojo = lookupMojo("mojo-with-eslint");
		File workingDirectory = readPrivate(mojo, "workingDirectory");

		mojo.execute();

		verifyStateFile(mojo, asList(
				join(workingDirectory, "index.js"),
// Path: src/test/java/com/github/mjeanroy/maven/plugins/node/tests/FileTestUtils.java
// public static File join(File root, String path, String... others) {
// 	File out = new File(root, path);
// 	for (String other : others) {
// 		out = new File(out, other);
// 	}
// 
// 	return out;
// }
// 
// Path: src/test/java/com/github/mjeanroy/maven/plugins/node/tests/ReflectTestUtils.java
// @SuppressWarnings("unchecked")
// public static <T> T readPrivate(Object instance, String name) {
// 	try {
// 		return (T) readField(instance, name, true);
// 	}
// 	catch (Exception ex) {
// 		throw new AssertionError(ex);
// 	}
// }
// 
// Path: src/test/java/com/github/mjeanroy/maven/plugins/node/tests/ReflectTestUtils.java
// public static <T> void writePrivate(Object instance, String name, T value) {
// 	try {
// 		writeField(instance, name, value, true);
// 	}
// 	catch (Exception ex) {
// 		throw new AssertionError(ex);
// 	}
// }


// Path: src/test/java/com/github/mjeanroy/maven/plugins/node/mojos/BuildMojoTest.java
import static com.github.mjeanroy.maven.plugins.node.tests.ReflectTestUtils.writePrivate;
import static java.util.Arrays.asList;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import org.apache.maven.plugin.logging.Log;
import org.junit.Test;
import java.io.File;
import static com.github.mjeanroy.maven.plugins.node.tests.FileTestUtils.join;
import static com.github.mjeanroy.maven.plugins.node.tests.ReflectTestUtils.readPrivate;

/**
 * The MIT License (MIT)
 *
 * Copyright (c) 2015-2021 Mickael Jeanroy
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.github.mjeanroy.maven.plugins.node.mojos;




public class BuildMojoTest extends AbstractNpmScriptIncrementalMojoTest<BuildMojo> {

	@Override
	String mojoName() {
		return "build";
	}

	@Override
	String scriptParameterName() {
		return "buildScript";
	}

	@Override
	void enableSkip(BuildMojo mojo) {
		writePrivate(mojo, "skipBuild", true);
	}

	@Test
	public void it_should_write_input_state_after_build() throws Exception {
		BuildMojo mojo = lookupMojo("mojo-with-eslint");
		File workingDirectory = readPrivate(mojo, "workingDirectory");

		mojo.execute();

		verifyStateFile(mojo, asList(
				join(workingDirectory, "index.js"),
				join(workingDirectory, "package.json"),