|
|
|
|
@@ -18,37 +18,22 @@ package org.springframework.cloud.contract.maven.verifier;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
|
|
import io.takari.maven.testing.TestMavenRuntime;
|
|
|
|
|
import io.takari.maven.testing.TestResources;
|
|
|
|
|
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
|
|
|
|
import org.junit.Rule;
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.test.rule.OutputCapture;
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
import static io.takari.maven.testing.TestMavenRuntime.newParameter;
|
|
|
|
|
import static io.takari.maven.testing.TestResources.assertFilesNotPresent;
|
|
|
|
|
import static io.takari.maven.testing.TestResources.assertFilesPresent;
|
|
|
|
|
import static java.nio.charset.Charset.defaultCharset;
|
|
|
|
|
import static org.apache.commons.io.FileUtils.readFileToString;
|
|
|
|
|
import static org.apache.maven.plugin.testing.MojoParameters.newParameter;
|
|
|
|
|
import static org.assertj.core.api.BDDAssertions.then;
|
|
|
|
|
|
|
|
|
|
public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Rule
|
|
|
|
|
public final TestResources resources = new TestResources();
|
|
|
|
|
|
|
|
|
|
@Rule
|
|
|
|
|
public final TestMavenRuntime maven = new TestMavenRuntime();
|
|
|
|
|
|
|
|
|
|
@Rule
|
|
|
|
|
public OutputCapture capture = new OutputCapture();
|
|
|
|
|
public class PluginUnitTest extends AbstractMojoTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateWireMockStubsInDefaultLocation() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic");
|
|
|
|
|
this.maven.executeMojo(basedir, "convert", defaultPackageForTests());
|
|
|
|
|
File basedir = getBasedir("basic");
|
|
|
|
|
executeMojo(basedir, "convert");
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/stubs/META-INF/org.springframework.cloud.verifier.sample/sample-project/0.1/mappings/Sample.json"
|
|
|
|
|
.replace("/", File.separator));
|
|
|
|
|
@@ -64,8 +49,8 @@ public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateWireMockFromStubsDirectory() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("withStubs");
|
|
|
|
|
this.maven.executeMojo(basedir, "convert", defaultPackageForTests(),
|
|
|
|
|
File basedir = getBasedir("withStubs");
|
|
|
|
|
executeMojo(basedir, "convert",
|
|
|
|
|
newParameter("contractsDirectory", "src/test/resources/stubs"));
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/stubs/META-INF/org.springframework.cloud.verifier.sample/sample-project/0.1/mappings/Sample.json"
|
|
|
|
|
@@ -74,8 +59,8 @@ public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldCopyContracts() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic");
|
|
|
|
|
this.maven.executeMojo(basedir, "convert", defaultPackageForTests());
|
|
|
|
|
File basedir = getBasedir("basic");
|
|
|
|
|
executeMojo(basedir, "convert");
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/stubs/META-INF/org.springframework.cloud.verifier.sample/sample-project/0.1/contracts/Sample.groovy"
|
|
|
|
|
.replace("/", File.separator));
|
|
|
|
|
@@ -86,17 +71,16 @@ public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateWireMockStubsInSelectedLocation() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic");
|
|
|
|
|
this.maven.executeMojo(basedir, "convert", defaultPackageForTests(),
|
|
|
|
|
newParameter("stubsDirectory", "target/foo"));
|
|
|
|
|
File basedir = getBasedir("basic");
|
|
|
|
|
executeMojo(basedir, "convert", newParameter("stubsDirectory", "target/foo"));
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/foo/META-INF/org.springframework.cloud.verifier.sample/sample-project/0.1/mappings/Sample.json");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateContractSpecificationInDefaultLocation() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic");
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
File basedir = getBasedir("basic");
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
newParameter("testFramework", "SPOCK"));
|
|
|
|
|
String path = "target/generated-test-sources/contracts/org/springframework/cloud/contract/verifier/tests/ContractVerifierSpec.groovy";
|
|
|
|
|
assertFilesPresent(basedir, path);
|
|
|
|
|
@@ -106,16 +90,16 @@ public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateContractTestsInDefaultLocation() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic");
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests());
|
|
|
|
|
File basedir = getBasedir("basic");
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests());
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/generated-test-sources/contracts/org/springframework/cloud/contract/verifier/tests/ContractVerifierTest.java");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateContractTestsWithCustomImports() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic");
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
File basedir = getBasedir("basic");
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
newParameter("imports", ""));
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/generated-test-sources/contracts/org/springframework/cloud/contract/verifier/tests/ContractVerifierTest.java");
|
|
|
|
|
@@ -123,8 +107,8 @@ public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateContractTestsWithoutArraySize() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic");
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests());
|
|
|
|
|
File basedir = getBasedir("basic");
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests());
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/generated-test-sources/contracts/org/springframework/cloud/contract/verifier/tests/ContractVerifierTest.java");
|
|
|
|
|
File test = new File(basedir,
|
|
|
|
|
@@ -134,8 +118,8 @@ public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateContractTestsWithArraySize() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic");
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
File basedir = getBasedir("basic");
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
newParameter("assertJsonSize", "true"));
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/generated-test-sources/contracts/org/springframework/cloud/contract/verifier/tests/ContractVerifierTest.java");
|
|
|
|
|
@@ -146,32 +130,30 @@ public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateStubs() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("generatedStubs");
|
|
|
|
|
this.maven.executeMojo(basedir, "generateStubs", defaultPackageForTests());
|
|
|
|
|
File basedir = getBasedir("generatedStubs");
|
|
|
|
|
executeMojo(basedir, "generateStubs");
|
|
|
|
|
assertFilesPresent(basedir, "target/sample-project-stubs.jar");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateStubsWithMappingsOnly() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("generatedStubs");
|
|
|
|
|
this.maven.executeMojo(basedir, "generateStubs", defaultPackageForTests(),
|
|
|
|
|
newParameter("attachContracts", "false"));
|
|
|
|
|
File basedir = getBasedir("generatedStubs");
|
|
|
|
|
executeMojo(basedir, "generateStubs");
|
|
|
|
|
assertFilesPresent(basedir, "target/sample-project-stubs.jar");
|
|
|
|
|
// FIXME: add assertion for jar content
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateStubsWithCustomClassifier() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("generatedStubs");
|
|
|
|
|
this.maven.executeMojo(basedir, "generateStubs", defaultPackageForTests(),
|
|
|
|
|
newParameter("classifier", "foo"));
|
|
|
|
|
File basedir = getBasedir("generatedStubs");
|
|
|
|
|
executeMojo(basedir, "generateStubs", newParameter("classifier", "foo"));
|
|
|
|
|
assertFilesPresent(basedir, "target/sample-project-foo.jar");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateStubsByDownloadingContractsFromARepo() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic-remote-contracts");
|
|
|
|
|
this.maven.executeMojo(basedir, "convert", defaultPackageForTests(),
|
|
|
|
|
File basedir = getBasedir("basic-remote-contracts");
|
|
|
|
|
executeMojo(basedir, "convert",
|
|
|
|
|
newParameter("contractsRepositoryUrl",
|
|
|
|
|
"file://" + PluginUnitTest.class.getClassLoader()
|
|
|
|
|
.getResource("m2repo/repository").getFile()
|
|
|
|
|
@@ -183,8 +165,8 @@ public class PluginUnitTest {
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateStubsByDownloadingContractsFromARepoWhenCustomPathIsProvided()
|
|
|
|
|
throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("complex-remote-contracts");
|
|
|
|
|
this.maven.executeMojo(basedir, "convert", defaultPackageForTests(),
|
|
|
|
|
File basedir = getBasedir("complex-remote-contracts");
|
|
|
|
|
executeMojo(basedir, "convert",
|
|
|
|
|
newParameter("contractsRepositoryUrl",
|
|
|
|
|
"file://" + PluginUnitTest.class.getClassLoader()
|
|
|
|
|
.getResource("m2repo/repository").getFile()
|
|
|
|
|
@@ -199,8 +181,8 @@ public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateOutputWhenCalledConvertFromRootProject() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("different-module-configuration");
|
|
|
|
|
this.maven.executeMojo(basedir, "convert", defaultPackageForTests());
|
|
|
|
|
File basedir = getBasedir("different-module-configuration");
|
|
|
|
|
executeMojo(basedir, "convert");
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/stubs/META-INF/com.blogspot.toomuchcoding.frauddetection/frauddetection-parent/0.1.0/mappings/shouldMarkClientAsFraud.json");
|
|
|
|
|
}
|
|
|
|
|
@@ -208,16 +190,16 @@ public class PluginUnitTest {
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateOutputWhenCalledGenerateTestsFromRootProject()
|
|
|
|
|
throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("different-module-configuration");
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests());
|
|
|
|
|
File basedir = getBasedir("different-module-configuration");
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests());
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/generated-test-sources/contracts/org/springframework/cloud/contract/verifier/tests/ContractVerifierTest.java");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateTestsByDownloadingContractsFromARepo() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic-remote-contracts");
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
File basedir = getBasedir("basic-remote-contracts");
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
newParameter("contractsRepositoryUrl",
|
|
|
|
|
"file://" + PluginUnitTest.class.getClassLoader()
|
|
|
|
|
.getResource("m2repo/repository").getFile()
|
|
|
|
|
@@ -229,8 +211,8 @@ public class PluginUnitTest {
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateTestsByDownloadingContractsFromARepoWhenCustomPathIsProvided()
|
|
|
|
|
throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("complex-remote-contracts");
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
File basedir = getBasedir("complex-remote-contracts");
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
newParameter("contractsRepositoryUrl",
|
|
|
|
|
"file://" + PluginUnitTest.class.getClassLoader()
|
|
|
|
|
.getResource("m2repo/repository").getFile()
|
|
|
|
|
@@ -246,9 +228,9 @@ public class PluginUnitTest {
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateContractTestsWithBaseClassResolvedFromConvention()
|
|
|
|
|
throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic-generated-baseclass");
|
|
|
|
|
File basedir = getBasedir("basic-generated-baseclass");
|
|
|
|
|
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
newParameter("testFramework", "JUNIT"));
|
|
|
|
|
|
|
|
|
|
String path = "target/generated-test-sources/contracts/org/springframework/cloud/contract/verifier/tests/hello/V1Test.java";
|
|
|
|
|
@@ -261,9 +243,9 @@ public class PluginUnitTest {
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateContractTestsWithBaseClassResolvedFromConventionForSpock()
|
|
|
|
|
throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic-generated-baseclass");
|
|
|
|
|
File basedir = getBasedir("basic-generated-baseclass");
|
|
|
|
|
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
newParameter("testFramework", "SPOCK"));
|
|
|
|
|
|
|
|
|
|
String path = "target/generated-test-sources/contracts/org/springframework/cloud/contract/verifier/tests/hello/V1Spec.groovy";
|
|
|
|
|
@@ -276,9 +258,9 @@ public class PluginUnitTest {
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateContractTestsWithBaseClassResolvedFromMapping()
|
|
|
|
|
throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic-baseclass-from-mappings");
|
|
|
|
|
File basedir = getBasedir("basic-baseclass-from-mappings");
|
|
|
|
|
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
newParameter("testFramework", "JUNIT"));
|
|
|
|
|
|
|
|
|
|
String path = "target/generated-test-sources/contracts/org/springframework/cloud/contract/verifier/tests/com/hello/V1Test.java";
|
|
|
|
|
@@ -291,9 +273,9 @@ public class PluginUnitTest {
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateContractTestsWithBaseClassResolvedFromMappingNameForSpock()
|
|
|
|
|
throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("basic-baseclass-from-mappings");
|
|
|
|
|
File basedir = getBasedir("basic-baseclass-from-mappings");
|
|
|
|
|
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
newParameter("testFramework", "SPOCK"));
|
|
|
|
|
|
|
|
|
|
String path = "target/generated-test-sources/contracts/org/springframework/cloud/contract/verifier/tests/com/hello/V1Spec.groovy";
|
|
|
|
|
@@ -306,9 +288,9 @@ public class PluginUnitTest {
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateContractTestsWithAFileContainingAListOfContracts()
|
|
|
|
|
throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("multiple-contracts");
|
|
|
|
|
File basedir = getBasedir("multiple-contracts");
|
|
|
|
|
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
newParameter("testFramework", "JUNIT"));
|
|
|
|
|
|
|
|
|
|
String path = "target/generated-test-sources/contracts/org/springframework/cloud/contract/verifier/tests/com/hello/V1Test.java";
|
|
|
|
|
@@ -322,10 +304,9 @@ public class PluginUnitTest {
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateStubsWithAFileContainingAListOfContracts()
|
|
|
|
|
throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("multiple-contracts");
|
|
|
|
|
File basedir = getBasedir("multiple-contracts");
|
|
|
|
|
|
|
|
|
|
this.maven.executeMojo(basedir, "convert", defaultPackageForTests(),
|
|
|
|
|
newParameter("stubsDirectory", "target/foo"));
|
|
|
|
|
executeMojo(basedir, "convert", newParameter("stubsDirectory", "target/foo"));
|
|
|
|
|
|
|
|
|
|
String firstFile = "target/foo/META-INF/org.springframework.cloud.verifier.sample/sample-project/0.1/mappings/com/hello/v1/should post a user.json";
|
|
|
|
|
File test = new File(basedir, firstFile);
|
|
|
|
|
@@ -341,14 +322,14 @@ public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateStubsForCommonRepoWithTargetFolder() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("common-repo");
|
|
|
|
|
File basedir = getBasedir("common-repo");
|
|
|
|
|
|
|
|
|
|
this.maven.executeMojo(basedir, "convert", defaultPackageForTests());
|
|
|
|
|
executeMojo(basedir, "convert");
|
|
|
|
|
|
|
|
|
|
assertFilesNotPresent(basedir, "target/generated-test-sources/contracts/");
|
|
|
|
|
// there will be no stubs cause all files are copied to `target` folder
|
|
|
|
|
assertFilesNotPresent(basedir,
|
|
|
|
|
"target/stubs/META-INF/org.springframework.cloud.verifier.sample/common-repo/0.1/mappings/");
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/stubs/META-INF/org.springframework.cloud.verifier.sample/common-repo/0.1/mappings/consumer1");
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/stubs/META-INF/org.springframework.cloud.verifier.sample/common-repo/0.1/contracts/consumer1/Messaging.groovy");
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
@@ -357,9 +338,9 @@ public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateContractTestsForPactAndMaintainIndents() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("pact");
|
|
|
|
|
File basedir = getBasedir("pact");
|
|
|
|
|
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests());
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests());
|
|
|
|
|
|
|
|
|
|
assertFilesPresent(basedir,
|
|
|
|
|
"target/generated-test-sources/contracts/org/springframework/cloud/contract/verifier/tests/ContractVerifierTest.java");
|
|
|
|
|
@@ -373,9 +354,9 @@ public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldRunPushStubsToScm() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("git-basic-remote-contracts");
|
|
|
|
|
File basedir = getBasedir("git-basic-remote-contracts");
|
|
|
|
|
|
|
|
|
|
this.maven.executeMojo(basedir, "pushStubsToScm", defaultPackageForTests());
|
|
|
|
|
executeMojo(basedir, "pushStubsToScm");
|
|
|
|
|
|
|
|
|
|
then(this.capture.toString())
|
|
|
|
|
.contains("Skipping pushing stubs to scm since your");
|
|
|
|
|
@@ -383,9 +364,9 @@ public class PluginUnitTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void shouldGenerateContractTestsForIncludedFilesPattern() throws Exception {
|
|
|
|
|
File basedir = this.resources.getBasedir("complex-common-repo-with-messaging");
|
|
|
|
|
File basedir = getBasedir("complex-common-repo-with-messaging");
|
|
|
|
|
|
|
|
|
|
this.maven.executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
executeMojo(basedir, "generateTests", defaultPackageForTests(),
|
|
|
|
|
newParameter("contractsRepositoryUrl",
|
|
|
|
|
"file://" + PluginUnitTest.class.getClassLoader()
|
|
|
|
|
.getResource("m2repo/repository").getFile()
|
|
|
|
|
|