// Path: src/main/java/com/github/danielflower/mavenplugins/release/ReleaseInvoker.java
// static final String DEPLOY = "deploy";
// 
// Path: src/main/java/com/github/danielflower/mavenplugins/release/ReleaseInvoker.java
// static final String SKIP_TESTS = "-DskipTests=true";


import org.apache.maven.model.Profile;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.invoker.InvocationRequest;
import org.apache.maven.shared.invoker.InvocationResult;
import org.apache.maven.shared.invoker.Invoker;
import org.apache.maven.shared.invoker.MavenInvocationException;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import java.io.File;
import java.util.LinkedList;
import java.util.List;
import static com.github.danielflower.mavenplugins.release.ReleaseInvoker.DEPLOY;
import static com.github.danielflower.mavenplugins.release.ReleaseInvoker.SKIP_TESTS;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.*;
	@Test
	public void runMavenBuild_UserExplicitlyWantsThisToBeReleased() throws Exception {
		when(reactor.getModulesInBuildOrder()).thenReturn(modulesInBuildOrder);
		modulesToRelease.add(MODULE_PATH);
		releaseInvoker.setModulesToRelease(modulesToRelease);
		releaseInvoker.runMavenBuild(reactor);
		verify(request).setProjects(Mockito.argThat(modules -> modules.size() == 1 && modules.contains(MODULE_PATH)));
	}

	@Test
	public void runMavenBuild_UserImplicitlyWantsThisToBeReleased() throws Exception {
		when(reactor.getModulesInBuildOrder()).thenReturn(modulesInBuildOrder);
		when(module.willBeReleased()).thenReturn(true);
		releaseInvoker.setModulesToRelease(modulesToRelease);
		releaseInvoker.runMavenBuild(reactor);
		verify(request).setProjects(Mockito.argThat(modules -> modules.size() == 1 && modules.contains(MODULE_PATH)));
	}

	@Test
	public void runMavenBuild_UserImplicitlyWantsThisToBeReleased_WillNotBeReleased() throws Exception {
		when(reactor.getModulesInBuildOrder()).thenReturn(modulesInBuildOrder);
		releaseInvoker.setModulesToRelease(modulesToRelease);
		releaseInvoker.runMavenBuild(reactor);
		verify(request).setProjects(Mockito.argThat(List::isEmpty));
	}

	@Test
	public void skipTests() throws Exception {
		releaseInvoker.setSkipTests(true);
		releaseInvoker.runMavenBuild(reactor);
// Path: src/main/java/com/github/danielflower/mavenplugins/release/ReleaseInvoker.java
// static final String DEPLOY = "deploy";
// 
// Path: src/main/java/com/github/danielflower/mavenplugins/release/ReleaseInvoker.java
// static final String SKIP_TESTS = "-DskipTests=true";


// Path: src/test/java/com/github/danielflower/mavenplugins/release/ReleaseInvokerTest.java
import org.apache.maven.model.Profile;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.invoker.InvocationRequest;
import org.apache.maven.shared.invoker.InvocationResult;
import org.apache.maven.shared.invoker.Invoker;
import org.apache.maven.shared.invoker.MavenInvocationException;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
import java.io.File;
import java.util.LinkedList;
import java.util.List;
import static com.github.danielflower.mavenplugins.release.ReleaseInvoker.DEPLOY;
import static com.github.danielflower.mavenplugins.release.ReleaseInvoker.SKIP_TESTS;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.*;

	@Test
	public void runMavenBuild_UserExplicitlyWantsThisToBeReleased() throws Exception {
		when(reactor.getModulesInBuildOrder()).thenReturn(modulesInBuildOrder);
		modulesToRelease.add(MODULE_PATH);
		releaseInvoker.setModulesToRelease(modulesToRelease);
		releaseInvoker.runMavenBuild(reactor);
		verify(request).setProjects(Mockito.argThat(modules -> modules.size() == 1 && modules.contains(MODULE_PATH)));
	}

	@Test
	public void runMavenBuild_UserImplicitlyWantsThisToBeReleased() throws Exception {
		when(reactor.getModulesInBuildOrder()).thenReturn(modulesInBuildOrder);
		when(module.willBeReleased()).thenReturn(true);
		releaseInvoker.setModulesToRelease(modulesToRelease);
		releaseInvoker.runMavenBuild(reactor);
		verify(request).setProjects(Mockito.argThat(modules -> modules.size() == 1 && modules.contains(MODULE_PATH)));
	}

	@Test
	public void runMavenBuild_UserImplicitlyWantsThisToBeReleased_WillNotBeReleased() throws Exception {
		when(reactor.getModulesInBuildOrder()).thenReturn(modulesInBuildOrder);
		releaseInvoker.setModulesToRelease(modulesToRelease);
		releaseInvoker.runMavenBuild(reactor);
		verify(request).setProjects(Mockito.argThat(List::isEmpty));
	}

	@Test
	public void skipTests() throws Exception {
		releaseInvoker.setSkipTests(true);
		releaseInvoker.runMavenBuild(reactor);
		verify(request).setGoals(Mockito.argThat(goals -> goals.size() == 2 && goals.contains(DEPLOY) && goals.contains(SKIP_TESTS)));