simplified config

[skip ci]
This commit is contained in:
Mariusz Smykula
2016-04-29 18:55:44 +02:00
parent 6e128c65da
commit 12173325d3
10 changed files with 2 additions and 219 deletions

View File

@@ -57,20 +57,6 @@ 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 {

View File

@@ -1,84 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework</groupId>
<artifactId>gs-rest-service</artifactId>
<version>0.1.0</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<!-- accurest test dependencies -->
<!-- tag::dependencies[] -->
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>rest-assured</artifactId>
<version>2.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>spring-mock-mvc</artifactId>
<version>2.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.toomuchcoding.jsonassert</groupId>
<artifactId>jsonassert</artifactId>
<version>0.4.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>2.4.0</version>
<scope>test</scope>
</dependency>
<!-- end::dependencies[] -->
</dependencies>
<properties>
<java.version>1.8</java.version>
<accurest-plugin.version>${it-plugin.version}</accurest-plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!-- tag::plugin[] -->
<plugin>
<groupId>io.codearte.accurest</groupId>
<artifactId>accurest-maven-plugin</artifactId>
<version>${accurest-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<baseClassForTests>hello.BaseAccurest</baseClassForTests>
</configuration>
</plugin>
<!-- end::plugin[] -->
</plugins>
</build>
</project>

View File

@@ -1,12 +0,0 @@
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);
}
}

View File

@@ -1,20 +0,0 @@
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;
}
}

View File

@@ -1,19 +0,0 @@
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));
}
}

View File

@@ -1,21 +0,0 @@
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!"
)
}
}

View File

@@ -1,17 +0,0 @@
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!"
)
}
}

View File

@@ -1,13 +0,0 @@
package hello;
import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc;
import org.junit.Before;
public class BaseAccurest {
@Before
public void setup() {
RestAssuredMockMvc.standaloneSetup(new GreetingController());
}
}

View File

@@ -69,21 +69,12 @@
<groupId>io.codearte.accurest</groupId>
<artifactId>accurest-maven-plugin</artifactId>
<version>${accurest-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>convert</goal>
<goal>generateStubs</goal>
<goal>generateTests</goal>
</goals>
</execution>
</executions>
<extensions>true</extensions>
<configuration>
<baseClassForTests>hello.BaseAccurest</baseClassForTests>
<testFramework>SPOCK</testFramework>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>

View File

@@ -73,15 +73,7 @@
<groupId>io.codearte.accurest</groupId>
<artifactId>accurest-maven-plugin</artifactId>
<version>${accurest-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>convert</goal>
<goal>generateStubs</goal>
<goal>generateTests</goal>
</goals>
</execution>
</executions>
<extensions>true</extensions>
<configuration>
<baseClassForTests>hello.BaseAccurest</baseClassForTests>
</configuration>