diff --git a/src/test/java/io/codearte/accurest/maven/PluginIT.java b/src/test/java/io/codearte/accurest/maven/PluginIT.java
index 4a4e396f46..268090b57a 100644
--- a/src/test/java/io/codearte/accurest/maven/PluginIT.java
+++ b/src/test/java/io/codearte/accurest/maven/PluginIT.java
@@ -57,6 +57,20 @@ public class PluginIT {
.assertErrorFreeLog();
}
+ @Test
+ public void should_build_project_with_plugin_extension() throws Exception {
+ File basedir = resources.getBasedir("plugin-extension");
+ maven.forProject(basedir)
+ .execute("package")
+ .assertErrorFreeLog()
+ .assertLogText("Generating server tests source code for Accurest contract verification")
+ .assertLogText("Generated 1 test classes.")
+ .assertLogText("Converting from accurest contracts written in GroovyDSL to WireMock stubs mappings")
+ .assertLogText("Creating new json")
+ .assertLogText("Running io.codearte.accurest.tests.AccurestTest")
+ .assertErrorFreeLog();
+ }
+
@Test
@Ignore("Ignored, because of bug accurest#245")
public void should_build_project_project_with_complex_configuration() throws Exception {
diff --git a/src/test/projects/plugin-extension/pom.xml b/src/test/projects/plugin-extension/pom.xml
new file mode 100644
index 0000000000..cebe6bce3e
--- /dev/null
+++ b/src/test/projects/plugin-extension/pom.xml
@@ -0,0 +1,84 @@
+
+
+ 4.0.0
+
+ org.springframework
+ gs-rest-service
+ 0.1.0
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 1.3.3.RELEASE
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ ch.qos.logback
+ logback-classic
+
+
+
+
+
+ com.jayway.restassured
+ rest-assured
+ 2.9.0
+ test
+
+
+ com.jayway.restassured
+ spring-mock-mvc
+ 2.9.0
+ test
+
+
+ com.toomuchcoding.jsonassert
+ jsonassert
+ 0.4.1
+ test
+
+
+ org.assertj
+ assertj-core
+ 2.4.0
+ test
+
+
+
+
+
+ 1.8
+ ${it-plugin.version}
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+ io.codearte.accurest
+ accurest-maven-plugin
+ ${accurest-plugin.version}
+ true
+
+ hello.BaseAccurest
+
+
+
+
+
+
diff --git a/src/test/projects/plugin-extension/src/main/java/hello/Application.java b/src/test/projects/plugin-extension/src/main/java/hello/Application.java
new file mode 100644
index 0000000000..5abd411428
--- /dev/null
+++ b/src/test/projects/plugin-extension/src/main/java/hello/Application.java
@@ -0,0 +1,12 @@
+package hello;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class Application {
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ }
+}
diff --git a/src/test/projects/plugin-extension/src/main/java/hello/Greeting.java b/src/test/projects/plugin-extension/src/main/java/hello/Greeting.java
new file mode 100644
index 0000000000..5d10b59b77
--- /dev/null
+++ b/src/test/projects/plugin-extension/src/main/java/hello/Greeting.java
@@ -0,0 +1,20 @@
+package hello;
+
+public class Greeting {
+
+ private final long id;
+ private final String content;
+
+ public Greeting(long id, String content) {
+ this.id = id;
+ this.content = content;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public String getContent() {
+ return content;
+ }
+}
diff --git a/src/test/projects/plugin-extension/src/main/java/hello/GreetingController.java b/src/test/projects/plugin-extension/src/main/java/hello/GreetingController.java
new file mode 100644
index 0000000000..e356ab2b10
--- /dev/null
+++ b/src/test/projects/plugin-extension/src/main/java/hello/GreetingController.java
@@ -0,0 +1,19 @@
+package hello;
+
+import java.util.concurrent.atomic.AtomicLong;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class GreetingController {
+
+ private static final String template = "Hello, %s!";
+ private final AtomicLong counter = new AtomicLong();
+
+ @RequestMapping("/greeting")
+ public Greeting greeting(@RequestParam(value="name", defaultValue="World") String name) {
+ return new Greeting(counter.incrementAndGet(),
+ String.format(template, name));
+ }
+}
diff --git a/src/test/projects/plugin-extension/src/test/accurest/greetings_ok.groovy b/src/test/projects/plugin-extension/src/test/accurest/greetings_ok.groovy
new file mode 100644
index 0000000000..0ffb665f6e
--- /dev/null
+++ b/src/test/projects/plugin-extension/src/test/accurest/greetings_ok.groovy
@@ -0,0 +1,21 @@
+io.codearte.accurest.dsl.GroovyDsl.make {
+ priority 2
+ request {
+ method 'GET'
+ urlPath('/greeting') {
+ queryParameters {
+ parameter 'name': 'Something'
+ }
+ }
+ headers {
+ header 'Content-Type': 'application/json'
+ }
+ }
+ response {
+ status 200
+ body(
+ id: 1,
+ content: "Hello, Something!"
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/test/projects/plugin-extension/src/test/accurest/greetings_with_default_value.groovy b/src/test/projects/plugin-extension/src/test/accurest/greetings_with_default_value.groovy
new file mode 100644
index 0000000000..2c5c32f159
--- /dev/null
+++ b/src/test/projects/plugin-extension/src/test/accurest/greetings_with_default_value.groovy
@@ -0,0 +1,17 @@
+io.codearte.accurest.dsl.GroovyDsl.make {
+ priority 2
+ request {
+ method 'GET'
+ url('/greeting')
+ headers {
+ header 'Content-Type': 'application/json'
+ }
+ }
+ response {
+ status 200
+ body(
+ id: 1,
+ content: "Hello, World!"
+ )
+ }
+}
\ No newline at end of file
diff --git a/src/test/projects/plugin-extension/src/test/java/hello/BaseAccurest.java b/src/test/projects/plugin-extension/src/test/java/hello/BaseAccurest.java
new file mode 100644
index 0000000000..d3bf7124e2
--- /dev/null
+++ b/src/test/projects/plugin-extension/src/test/java/hello/BaseAccurest.java
@@ -0,0 +1,13 @@
+package hello;
+
+import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc;
+import org.junit.Before;
+
+public class BaseAccurest {
+
+ @Before
+ public void setup() {
+ RestAssuredMockMvc.standaloneSetup(new GreetingController());
+ }
+
+}
diff --git a/src/test/projects/spring-boot-groovy/pom.xml b/src/test/projects/spring-boot-groovy/pom.xml
index 4df8f23a89..fcc5045b80 100644
--- a/src/test/projects/spring-boot-groovy/pom.xml
+++ b/src/test/projects/spring-boot-groovy/pom.xml
@@ -68,12 +68,21 @@
io.codearte.accurest
accurest-maven-plugin
${accurest-plugin.version}
- true
+
+
+
+ convert
+ generateStubs
+ generateTests
+
+
+
hello.BaseAccurest
SPOCK
+
org.codehaus.gmavenplus
gmavenplus-plugin
diff --git a/src/test/projects/spring-boot-java/pom.xml b/src/test/projects/spring-boot-java/pom.xml
index cebe6bce3e..ecda0561c2 100644
--- a/src/test/projects/spring-boot-java/pom.xml
+++ b/src/test/projects/spring-boot-java/pom.xml
@@ -73,7 +73,15 @@
io.codearte.accurest
accurest-maven-plugin
${accurest-plugin.version}
- true
+
+
+
+ convert
+ generateStubs
+ generateTests
+
+
+
hello.BaseAccurest