// Path: src/main/java/com/github/ferstl/depgraph/graph/EdgeRenderer.java
// public interface EdgeRenderer<T> {
// 
//   String render(T from, T to);
// }
// 
// Path: src/test/java/com/github/ferstl/depgraph/dependency/DependencyNodeUtil.java
// public static DependencyNode createDependencyNode(String groupId, String artifactId, String version) {
//   return new DependencyNode(createArtifact(groupId, artifactId, version, false));
// }
// 
// Path: src/test/java/com/github/ferstl/depgraph/dependency/DependencyNodeUtil.java
// public static DependencyNode createDependencyNodeWithConflict(String groupId, String artifactId, String effectiveVersion) {
//   return createDependencyNodeWithConflict(groupId, artifactId, effectiveVersion, "compile");
// }
// 
// Path: src/test/java/com/github/ferstl/depgraph/dependency/DependencyNodeUtil.java
// public static DependencyNode createDependencyNodeWithDuplicate(String groupId, String artifactId, String version) {
//   Artifact artifact = createArtifact(groupId, artifactId, version, "compile", "jar", "", false);
//   return createConflict(artifact, artifact.getVersion());
// }


import org.junit.jupiter.api.Test;
import com.github.ferstl.depgraph.graph.EdgeRenderer;
import static com.github.ferstl.depgraph.dependency.DependencyNodeUtil.createDependencyNode;
import static com.github.ferstl.depgraph.dependency.DependencyNodeUtil.createDependencyNodeWithConflict;
import static com.github.ferstl.depgraph.dependency.DependencyNodeUtil.createDependencyNodeWithDuplicate;
import static org.junit.jupiter.api.Assertions.assertEquals;
/*
 * Copyright (c) 2014 - 2019 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.ferstl.depgraph.dependency;


public abstract class AbstractDependencyEdgeRendererTest {

  @Test
  final void renderWithoutVersion() {
    // arrange
    EdgeRenderer<DependencyNode> renderer = createEdgeRenderer(false);
    DependencyNode from = createDependencyNode("group1", "artifact1", "version1");
    DependencyNode to = createDependencyNode("group2", "artifact2", "version2");

    // act
    String result = renderer.render(from, to);

    // assert
    assertEquals(renderWithoutVersionResult(), result);
  }

  @Test
  final void renderWithNonConflictingVersion() {
    // arrange
    EdgeRenderer<DependencyNode> renderer = createEdgeRenderer(true);
    DependencyNode from = createDependencyNode("group1", "artifact1", "version1");
    DependencyNode to = createDependencyNode("group2", "artifact2", "version2");

    // act
    String result = renderer.render(from, to);

    // assert
    assertEquals(renderWithNonConflictingVersionResult(), result);
  }

  @Test
  final void renderWithConflictShowingVersion() {
    // arrange
    EdgeRenderer<DependencyNode> renderer = createEdgeRenderer(true);
    DependencyNode from = createDependencyNode("group1", "artifact1", "version1");
    DependencyNode to = createDependencyNodeWithConflict("group2", "artifact2", "version2");

    // act
    String result = renderer.render(from, to);

    // assert
// Path: src/main/java/com/github/ferstl/depgraph/graph/EdgeRenderer.java
// public interface EdgeRenderer<T> {
// 
//   String render(T from, T to);
// }
// 
// Path: src/test/java/com/github/ferstl/depgraph/dependency/DependencyNodeUtil.java
// public static DependencyNode createDependencyNode(String groupId, String artifactId, String version) {
//   return new DependencyNode(createArtifact(groupId, artifactId, version, false));
// }
// 
// Path: src/test/java/com/github/ferstl/depgraph/dependency/DependencyNodeUtil.java
// public static DependencyNode createDependencyNodeWithConflict(String groupId, String artifactId, String effectiveVersion) {
//   return createDependencyNodeWithConflict(groupId, artifactId, effectiveVersion, "compile");
// }
// 
// Path: src/test/java/com/github/ferstl/depgraph/dependency/DependencyNodeUtil.java
// public static DependencyNode createDependencyNodeWithDuplicate(String groupId, String artifactId, String version) {
//   Artifact artifact = createArtifact(groupId, artifactId, version, "compile", "jar", "", false);
//   return createConflict(artifact, artifact.getVersion());
// }


// Path: src/test/java/com/github/ferstl/depgraph/dependency/AbstractDependencyEdgeRendererTest.java
import org.junit.jupiter.api.Test;
import com.github.ferstl.depgraph.graph.EdgeRenderer;
import static com.github.ferstl.depgraph.dependency.DependencyNodeUtil.createDependencyNode;
import static com.github.ferstl.depgraph.dependency.DependencyNodeUtil.createDependencyNodeWithConflict;
import static com.github.ferstl.depgraph.dependency.DependencyNodeUtil.createDependencyNodeWithDuplicate;
import static org.junit.jupiter.api.Assertions.assertEquals;

/*
 * Copyright (c) 2014 - 2019 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.ferstl.depgraph.dependency;


public abstract class AbstractDependencyEdgeRendererTest {

  @Test
  final void renderWithoutVersion() {
    // arrange
    EdgeRenderer<DependencyNode> renderer = createEdgeRenderer(false);
    DependencyNode from = createDependencyNode("group1", "artifact1", "version1");
    DependencyNode to = createDependencyNode("group2", "artifact2", "version2");

    // act
    String result = renderer.render(from, to);

    // assert
    assertEquals(renderWithoutVersionResult(), result);
  }

  @Test
  final void renderWithNonConflictingVersion() {
    // arrange
    EdgeRenderer<DependencyNode> renderer = createEdgeRenderer(true);
    DependencyNode from = createDependencyNode("group1", "artifact1", "version1");
    DependencyNode to = createDependencyNode("group2", "artifact2", "version2");

    // act
    String result = renderer.render(from, to);

    // assert
    assertEquals(renderWithNonConflictingVersionResult(), result);
  }

  @Test
  final void renderWithConflictShowingVersion() {
    // arrange
    EdgeRenderer<DependencyNode> renderer = createEdgeRenderer(true);
    DependencyNode from = createDependencyNode("group1", "artifact1", "version1");
    DependencyNode to = createDependencyNodeWithConflict("group2", "artifact2", "version2");

    // act
    String result = renderer.render(from, to);

    // assert
    assertEquals(renderWithConflictShowingVersionResult(), result);