package io.leonard.maven.plugins.jspc;

import org.apache.maven.plugin.testing.MojoRule;
import org.junit.Rule;
import org.junit.Test;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * Test {@link JspcMojo}
 */
public class TestIncludesExcludesMojo {

  @Rule
  public MojoRule rule = new MojoRule();

  @Test
  public void shouldRespectIncludesAndExcludes() throws Exception {
    // Given
    File oneJspProject = new File("target/test-classes/unit/project_include_exclude");

    // When
    rule.executeMojo(oneJspProject, "compile");

    // Then
    Path jspPath = Paths.get("target/test-classes/unit/project_include_exclude/target/classes/jsp/jsp/_01_jsp.class");
    assertThat(jspPath).exists();

    Path jspfPath = Paths.get("target/test-classes/unit/project_include_exclude/target/classes/jsp/jsp/_02_jspf.class");
    assertThat(jspfPath).doesNotExist();
  }

}

@@ -389,16 +389,175 @@
 ule();%0A%0A
+  private String PROJECT_PATH = %22target/test-classes/unit/project_include_exclude%22;%0A  private String TARGET_PATH = PROJECT_PATH + %22/target/classes/jsp/jsp/%22;%0A%0A
   @Test%0A
@@ -646,22 +646,30 @@
    File 
-oneJsp
+includeExclude
 Project 
@@ -683,58 +683,20 @@
 ile(
-%22target/test-classes/unit/project_include_exclude%22
+PROJECT_PATH
 );%0A%0A
@@ -732,14 +732,22 @@
 ojo(
-oneJsp
+includeExclude
 Proj
@@ -809,81 +809,23 @@
 get(
-%22target/test-classes/unit/project_include_exclude/target/classes/jsp/jsp/
+TARGET_PATH + %22
 _01_
@@ -906,81 +906,23 @@
 get(
-%22target/test-classes/unit/project_include_exclude/target/classes/jsp/jsp/
+TARGET_PATH + %22
 _02_

Refactor test