Skip to content

Commit 4d7a28b

Browse files
committed
fix: replace AssertJ with Hamcrest
1 parent 7174c42 commit 4d7a28b

File tree

1 file changed

+15
-25
lines changed

1 file changed

+15
-25
lines changed

consumer/src/test/kotlin/au/com/dius/pact/consumer/dsl/DslJsonBodyBuilderTest.kt

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package au.com.dius.pact.consumer.dsl
22

3+
import org.hamcrest.MatcherAssert.assertThat
4+
import org.hamcrest.Matchers.equalTo
5+
import org.hamcrest.Matchers.`is`
36
import org.junit.jupiter.params.ParameterizedTest
47
import org.junit.jupiter.params.provider.MethodSource
58
import kotlin.reflect.KClass
6-
import org.assertj.core.api.Assertions.assertThat
79
import org.junit.jupiter.api.Test
810
import java.time.ZonedDateTime
911
import java.util.stream.Stream
@@ -22,8 +24,7 @@ internal class DslJsonBodyBuilderTest {
2224
val expectedBody =
2325
LambdaDsl.newJsonBody { }
2426

25-
assertThat(actualJsonBody.pactDslObject.toString())
26-
.isEqualTo(expectedBody.pactDslObject.toString())
27+
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
2728
}
2829

2930
@ParameterizedTest
@@ -34,8 +35,7 @@ internal class DslJsonBodyBuilderTest {
3435
val expectedBody =
3536
LambdaDsl.newJsonBody { it.stringType("property") }
3637

37-
assertThat(actualJsonBody.pactDslObject.toString())
38-
.isEqualTo(expectedBody.pactDslObject.toString())
38+
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
3939
}
4040

4141
@Test
@@ -47,8 +47,7 @@ internal class DslJsonBodyBuilderTest {
4747
val expectedBody =
4848
LambdaDsl.newJsonBody { it.stringType("property") }
4949

50-
assertThat(actualJsonBody.pactDslObject.toString())
51-
.isEqualTo(expectedBody.pactDslObject.toString())
50+
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
5251
}
5352

5453
@Test
@@ -60,8 +59,7 @@ internal class DslJsonBodyBuilderTest {
6059
val expectedBody =
6160
LambdaDsl.newJsonBody { it.booleanType("property") }
6261

63-
assertThat(actualJsonBody.pactDslObject.toString())
64-
.isEqualTo(expectedBody.pactDslObject.toString())
62+
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
6563
}
6664

6765
@ParameterizedTest
@@ -72,8 +70,7 @@ internal class DslJsonBodyBuilderTest {
7270
val expectedBody =
7371
LambdaDsl.newJsonBody { it.numberType("property") }
7472

75-
assertThat(actualJsonBody.pactDslObject.toString())
76-
.isEqualTo(expectedBody.pactDslObject.toString())
73+
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
7774
}
7875

7976
@Test
@@ -85,8 +82,7 @@ internal class DslJsonBodyBuilderTest {
8582
val expectedBody =
8683
LambdaDsl.newJsonBody { it.datetime("property", "yyyy-MM-dd'T'HH:mm:ssZZ") }
8784

88-
assertThat(actualJsonBody.pactDslObject.toString())
89-
.isEqualTo(expectedBody.pactDslObject.toString())
85+
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
9086
}
9187

9288
@Test
@@ -98,8 +94,7 @@ internal class DslJsonBodyBuilderTest {
9894
val expectedBody =
9995
LambdaDsl.newJsonBody { it.array("property") {} }
10096

101-
assertThat(actualJsonBody.pactDslObject.toString())
102-
.isEqualTo(expectedBody.pactDslObject.toString())
97+
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
10398
}
10499

105100
@Test
@@ -114,8 +109,7 @@ internal class DslJsonBodyBuilderTest {
114109
root.`object`("inner") { it.stringType("property") }
115110
}
116111

117-
assertThat(actualJsonBody.pactDslObject.toString())
118-
.isEqualTo(expectedBody.pactDslObject.toString())
112+
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
119113
}
120114

121115
@Test
@@ -136,8 +130,7 @@ internal class DslJsonBodyBuilderTest {
136130
}
137131
}
138132

139-
assertThat(actualJsonBody.pactDslObject.toString())
140-
.isEqualTo(expectedBody.pactDslObject.toString())
133+
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
141134
}
142135

143136
data class InnerObjectRequiredProperty(val property: ObjectRequiredProperty)
@@ -151,8 +144,7 @@ internal class DslJsonBodyBuilderTest {
151144
root.`object`("inner") { it.`object`("property") { } }
152145
}
153146

154-
assertThat(actualJsonBody.pactDslObject.toString())
155-
.isEqualTo(expectedBody.pactDslObject.toString())
147+
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
156148
}
157149

158150
data class ThirdProperty(val dependOnFirst: FirstProperty, val property: String)
@@ -172,8 +164,7 @@ internal class DslJsonBodyBuilderTest {
172164
}
173165
}
174166

175-
assertThat(actualJsonBody.pactDslObject.toString())
176-
.isEqualTo(expectedBody.pactDslObject.toString())
167+
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
177168
}
178169

179170
@Test
@@ -197,8 +188,7 @@ internal class DslJsonBodyBuilderTest {
197188
}
198189
}
199190

200-
assertThat(actualJsonBody.pactDslObject.toString())
201-
.isEqualTo(expectedBody.pactDslObject.toString())
191+
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
202192
}
203193

204194
companion object {

0 commit comments

Comments
 (0)