// Path: src/test/java/com/github/ferstl/depgraph/MavenVersion.java
// public static final String MAX_VERSION = "3.6.3";
// 
// Path: src/test/java/com/github/ferstl/depgraph/MavenVersion.java
// public static final String MIN_VERSION = "3.2.5";


import java.io.File;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import io.takari.maven.testing.TestProperties;
import io.takari.maven.testing.TestResources;
import io.takari.maven.testing.executor.MavenExecutionResult;
import io.takari.maven.testing.executor.MavenRuntime;
import io.takari.maven.testing.executor.MavenVersions;
import io.takari.maven.testing.executor.junit.MavenJUnitTestRunner;
import static com.github.ferstl.depgraph.MavenVersion.MAX_VERSION;
import static com.github.ferstl.depgraph.MavenVersion.MIN_VERSION;
import static io.takari.maven.testing.TestResources.assertFileContents;
    MavenExecutionResult result = this.mavenRuntime
        .forProject(basedir)
        .withCliOption("-Dartifact=org.springframework:spring-jdbc:5.1.3.RELEASE")
        .withCliOption("-DgroupId=org.springframework")
        .withCliOption("-DartifactId=spring-jdbc")
        .withCliOption("-Dversion=5.1.3.RELEASE")
        .execute(createFullyQualifiedGoal());

    // assert
    result.assertLogText("[ERROR] Failed to execute goal com.github.ferstl:depgraph-maven-plugin");
    result.assertLogText("Artifact can be defined with either 'artifact' or 'groupId'/'artifactId'/'version' but not both");
  }

  @Test
  public void runWithInvalidArtifactParameter() throws Exception {
    // arrange
    File basedir = this.resources.getBasedir("no-project");

    // act
    MavenExecutionResult result = this.mavenRuntime
        .forProject(basedir)
        .withCliOption("-Dartifact=org.springframework:spring-jdbc")
        .execute(createFullyQualifiedGoal());

    // assert
    result.assertLogText("[ERROR] Failed to execute goal com.github.ferstl:depgraph-maven-plugin");
    result.assertLogText("Invalid artifact definition: org.springframework:spring-jdbc");
  }

  @Test
// Path: src/test/java/com/github/ferstl/depgraph/MavenVersion.java
// public static final String MAX_VERSION = "3.6.3";
// 
// Path: src/test/java/com/github/ferstl/depgraph/MavenVersion.java
// public static final String MIN_VERSION = "3.2.5";


// Path: src/test/java/com/github/ferstl/depgraph/ForArtifactIntegrationTest.java
import java.io.File;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import io.takari.maven.testing.TestProperties;
import io.takari.maven.testing.TestResources;
import io.takari.maven.testing.executor.MavenExecutionResult;
import io.takari.maven.testing.executor.MavenRuntime;
import io.takari.maven.testing.executor.MavenVersions;
import io.takari.maven.testing.executor.junit.MavenJUnitTestRunner;
import static com.github.ferstl.depgraph.MavenVersion.MAX_VERSION;
import static com.github.ferstl.depgraph.MavenVersion.MIN_VERSION;
import static io.takari.maven.testing.TestResources.assertFileContents;

    MavenExecutionResult result = this.mavenRuntime
        .forProject(basedir)
        .withCliOption("-Dartifact=org.springframework:spring-jdbc:5.1.3.RELEASE")
        .withCliOption("-DgroupId=org.springframework")
        .withCliOption("-DartifactId=spring-jdbc")
        .withCliOption("-Dversion=5.1.3.RELEASE")
        .execute(createFullyQualifiedGoal());

    // assert
    result.assertLogText("[ERROR] Failed to execute goal com.github.ferstl:depgraph-maven-plugin");
    result.assertLogText("Artifact can be defined with either 'artifact' or 'groupId'/'artifactId'/'version' but not both");
  }

  @Test
  public void runWithInvalidArtifactParameter() throws Exception {
    // arrange
    File basedir = this.resources.getBasedir("no-project");

    // act
    MavenExecutionResult result = this.mavenRuntime
        .forProject(basedir)
        .withCliOption("-Dartifact=org.springframework:spring-jdbc")
        .execute(createFullyQualifiedGoal());

    // assert
    result.assertLogText("[ERROR] Failed to execute goal com.github.ferstl:depgraph-maven-plugin");
    result.assertLogText("Invalid artifact definition: org.springframework:spring-jdbc");
  }

  @Test
  public void runWithIncompleteGavParameters() throws Exception {