generating wiremock stubs from accurest contracts

This commit is contained in:
Mariusz Smykula
2016-03-25 22:42:47 +01:00
parent edb8a60a0f
commit dc7c350e5a
6 changed files with 247 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
package io.codearte.accurest.maven;
import static io.takari.maven.testing.TestResources.assertFilesPresent;
import java.io.File;
import org.junit.Rule;
import org.junit.Test;
import io.takari.maven.testing.TestMavenRuntime;
import io.takari.maven.testing.TestResources;
public class PluginUnitTest {
@Rule
public final TestResources resources = new TestResources();
@Rule
public final TestMavenRuntime maven = new TestMavenRuntime();
@Test
public void shouldGenerateWarlockStubsInDefaultLocation() throws Exception {
File basedir = resources.getBasedir("basic");
maven.executeMojo(basedir, "generateStubs");
assertFilesPresent(basedir, "target/mappings/Sample.json");
}
@Test
public void shouldGenerateWarlockStubsInSelectedLocation() throws Exception {
File basedir = resources.getBasedir("basic");
maven.executeMojo(basedir, "generateStubs", TestMavenRuntime.newParameter("mappingsDir", "foo"));
assertFilesPresent(basedir, "target/foo/Sample.json");
}
}