1
1
package au.com.dius.pact.consumer.dsl
2
2
3
+ import org.hamcrest.MatcherAssert.assertThat
4
+ import org.hamcrest.Matchers.equalTo
5
+ import org.hamcrest.Matchers.`is`
3
6
import org.junit.jupiter.params.ParameterizedTest
4
7
import org.junit.jupiter.params.provider.MethodSource
5
8
import kotlin.reflect.KClass
6
- import org.assertj.core.api.Assertions.assertThat
7
9
import org.junit.jupiter.api.Test
8
10
import java.time.ZonedDateTime
9
11
import java.util.stream.Stream
@@ -22,8 +24,7 @@ internal class DslJsonBodyBuilderTest {
22
24
val expectedBody =
23
25
LambdaDsl .newJsonBody { }
24
26
25
- assertThat(actualJsonBody.pactDslObject.toString())
26
- .isEqualTo(expectedBody.pactDslObject.toString())
27
+ assertThat(actualJsonBody.pactDslObject.toString(), `is `(equalTo(expectedBody.pactDslObject.toString())))
27
28
}
28
29
29
30
@ParameterizedTest
@@ -34,8 +35,7 @@ internal class DslJsonBodyBuilderTest {
34
35
val expectedBody =
35
36
LambdaDsl .newJsonBody { it.stringType(" property" ) }
36
37
37
- assertThat(actualJsonBody.pactDslObject.toString())
38
- .isEqualTo(expectedBody.pactDslObject.toString())
38
+ assertThat(actualJsonBody.pactDslObject.toString(), `is `(equalTo(expectedBody.pactDslObject.toString())))
39
39
}
40
40
41
41
@Test
@@ -47,8 +47,7 @@ internal class DslJsonBodyBuilderTest {
47
47
val expectedBody =
48
48
LambdaDsl .newJsonBody { it.stringType(" property" ) }
49
49
50
- assertThat(actualJsonBody.pactDslObject.toString())
51
- .isEqualTo(expectedBody.pactDslObject.toString())
50
+ assertThat(actualJsonBody.pactDslObject.toString(), `is `(equalTo(expectedBody.pactDslObject.toString())))
52
51
}
53
52
54
53
@Test
@@ -60,8 +59,7 @@ internal class DslJsonBodyBuilderTest {
60
59
val expectedBody =
61
60
LambdaDsl .newJsonBody { it.booleanType(" property" ) }
62
61
63
- assertThat(actualJsonBody.pactDslObject.toString())
64
- .isEqualTo(expectedBody.pactDslObject.toString())
62
+ assertThat(actualJsonBody.pactDslObject.toString(), `is `(equalTo(expectedBody.pactDslObject.toString())))
65
63
}
66
64
67
65
@ParameterizedTest
@@ -72,8 +70,7 @@ internal class DslJsonBodyBuilderTest {
72
70
val expectedBody =
73
71
LambdaDsl .newJsonBody { it.numberType(" property" ) }
74
72
75
- assertThat(actualJsonBody.pactDslObject.toString())
76
- .isEqualTo(expectedBody.pactDslObject.toString())
73
+ assertThat(actualJsonBody.pactDslObject.toString(), `is `(equalTo(expectedBody.pactDslObject.toString())))
77
74
}
78
75
79
76
@Test
@@ -85,8 +82,7 @@ internal class DslJsonBodyBuilderTest {
85
82
val expectedBody =
86
83
LambdaDsl .newJsonBody { it.datetime(" property" , " yyyy-MM-dd'T'HH:mm:ssZZ" ) }
87
84
88
- assertThat(actualJsonBody.pactDslObject.toString())
89
- .isEqualTo(expectedBody.pactDslObject.toString())
85
+ assertThat(actualJsonBody.pactDslObject.toString(), `is `(equalTo(expectedBody.pactDslObject.toString())))
90
86
}
91
87
92
88
@Test
@@ -98,8 +94,7 @@ internal class DslJsonBodyBuilderTest {
98
94
val expectedBody =
99
95
LambdaDsl .newJsonBody { it.array(" property" ) {} }
100
96
101
- assertThat(actualJsonBody.pactDslObject.toString())
102
- .isEqualTo(expectedBody.pactDslObject.toString())
97
+ assertThat(actualJsonBody.pactDslObject.toString(), `is `(equalTo(expectedBody.pactDslObject.toString())))
103
98
}
104
99
105
100
@Test
@@ -114,8 +109,7 @@ internal class DslJsonBodyBuilderTest {
114
109
root.`object `(" inner" ) { it.stringType(" property" ) }
115
110
}
116
111
117
- assertThat(actualJsonBody.pactDslObject.toString())
118
- .isEqualTo(expectedBody.pactDslObject.toString())
112
+ assertThat(actualJsonBody.pactDslObject.toString(), `is `(equalTo(expectedBody.pactDslObject.toString())))
119
113
}
120
114
121
115
@Test
@@ -136,8 +130,7 @@ internal class DslJsonBodyBuilderTest {
136
130
}
137
131
}
138
132
139
- assertThat(actualJsonBody.pactDslObject.toString())
140
- .isEqualTo(expectedBody.pactDslObject.toString())
133
+ assertThat(actualJsonBody.pactDslObject.toString(), `is `(equalTo(expectedBody.pactDslObject.toString())))
141
134
}
142
135
143
136
data class InnerObjectRequiredProperty (val property : ObjectRequiredProperty )
@@ -151,8 +144,7 @@ internal class DslJsonBodyBuilderTest {
151
144
root.`object `(" inner" ) { it.`object `(" property" ) { } }
152
145
}
153
146
154
- assertThat(actualJsonBody.pactDslObject.toString())
155
- .isEqualTo(expectedBody.pactDslObject.toString())
147
+ assertThat(actualJsonBody.pactDslObject.toString(), `is `(equalTo(expectedBody.pactDslObject.toString())))
156
148
}
157
149
158
150
data class ThirdProperty (val dependOnFirst : FirstProperty , val property : String )
@@ -172,8 +164,7 @@ internal class DslJsonBodyBuilderTest {
172
164
}
173
165
}
174
166
175
- assertThat(actualJsonBody.pactDslObject.toString())
176
- .isEqualTo(expectedBody.pactDslObject.toString())
167
+ assertThat(actualJsonBody.pactDslObject.toString(), `is `(equalTo(expectedBody.pactDslObject.toString())))
177
168
}
178
169
179
170
@Test
@@ -197,8 +188,7 @@ internal class DslJsonBodyBuilderTest {
197
188
}
198
189
}
199
190
200
- assertThat(actualJsonBody.pactDslObject.toString())
201
- .isEqualTo(expectedBody.pactDslObject.toString())
191
+ assertThat(actualJsonBody.pactDslObject.toString(), `is `(equalTo(expectedBody.pactDslObject.toString())))
202
192
}
203
193
204
194
companion object {
0 commit comments