Wrangle tests to pass

This commit is contained in:
Dave Syer
2016-07-11 10:43:34 +01:00
parent 809e71f1d9
commit 6c287a09ec
7 changed files with 30 additions and 11 deletions

View File

@@ -139,7 +139,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.0</version>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@@ -316,11 +316,15 @@
<artifactId>maven-aether-provider</artifactId>
<version>3.3.9</version>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-spring</artifactId>
<version>1.0-groovy-2.4</version>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>1.0-groovy-2.4</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

View File

@@ -28,7 +28,7 @@
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<artifactId>spock-spring</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -38,7 +38,7 @@
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<artifactId>spock-spring</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -19,6 +19,7 @@ package org.springframework.cloud.contract.stubrunner.spring.cloud
import org.apache.curator.test.TestingServer
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationContextLoader
import org.springframework.boot.test.WebIntegrationTest
import org.springframework.cloud.contract.stubrunner.StubFinder
@@ -39,6 +40,7 @@ import spock.lang.Specification
*/
@ContextConfiguration(classes = Config, loader = SpringApplicationContextLoader)
@WebIntegrationTest(randomPort = true)
@IntegrationTest
class StubRunnerSpringCloudAutoConfigurationSpec extends Specification {
@Autowired StubFinder stubFinder

View File

@@ -32,7 +32,7 @@
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<artifactId>spock-spring</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@@ -69,6 +69,11 @@
<groupId>org.apache.maven</groupId>
<artifactId>maven-aether-provider</artifactId>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
@@ -80,4 +85,12 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@@ -196,16 +196,16 @@ class JsonToJsonPathsConverterSpec extends Specification {
JsonPaths pathAndValues = new JsonToJsonPathsConverter().transformToJsonPathWithTestsSideValues(new JsonSlurper().parseText(json))
then:
pathAndValues.find {
it.method() == """.field("extensions").field("7").isEqualTo(28)""" &&
it.jsonPath() == '''$.extensions[?(@.7 == 28)]'''
it.method() == """.field("extensions").field("7").isEqualTo(28.00)""" &&
it.jsonPath() == '''$.extensions[?(@.7 == 28.00)]'''
}
pathAndValues.find {
it.method() == """.field("extensions").field("14").isEqualTo(41)""" &&
it.jsonPath() == '''$.extensions[?(@.14 == 41)]'''
it.method() == """.field("extensions").field("14").isEqualTo(41.00)""" &&
it.jsonPath() == '''$.extensions[?(@.14 == 41.00)]'''
}
pathAndValues.find {
it.method() == """.field("extensions").field("30").isEqualTo(60)""" &&
it.jsonPath() == '''$.extensions[?(@.30 == 60)]'''
it.method() == """.field("extensions").field("30").isEqualTo(60.00)""" &&
it.jsonPath() == '''$.extensions[?(@.30 == 60.00)]'''
}
and:
assertThatJsonPathsInMapAreValid(json, pathAndValues)