Skip to content

Commit

Permalink
fix: replace AssertJ with Hamcrest
Browse files Browse the repository at this point in the history
  • Loading branch information
rholshausen committed Oct 26, 2022
1 parent 7174c42 commit 4d7a28b
Showing 1 changed file with 15 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package au.com.dius.pact.consumer.dsl

import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.equalTo
import org.hamcrest.Matchers.`is`
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.MethodSource
import kotlin.reflect.KClass
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import java.time.ZonedDateTime
import java.util.stream.Stream
Expand All @@ -22,8 +24,7 @@ internal class DslJsonBodyBuilderTest {
val expectedBody =
LambdaDsl.newJsonBody { }

assertThat(actualJsonBody.pactDslObject.toString())
.isEqualTo(expectedBody.pactDslObject.toString())
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
}

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

assertThat(actualJsonBody.pactDslObject.toString())
.isEqualTo(expectedBody.pactDslObject.toString())
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
}

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

assertThat(actualJsonBody.pactDslObject.toString())
.isEqualTo(expectedBody.pactDslObject.toString())
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
}

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

assertThat(actualJsonBody.pactDslObject.toString())
.isEqualTo(expectedBody.pactDslObject.toString())
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
}

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

assertThat(actualJsonBody.pactDslObject.toString())
.isEqualTo(expectedBody.pactDslObject.toString())
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
}

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

assertThat(actualJsonBody.pactDslObject.toString())
.isEqualTo(expectedBody.pactDslObject.toString())
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
}

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

assertThat(actualJsonBody.pactDslObject.toString())
.isEqualTo(expectedBody.pactDslObject.toString())
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
}

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

assertThat(actualJsonBody.pactDslObject.toString())
.isEqualTo(expectedBody.pactDslObject.toString())
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
}

@Test
Expand All @@ -136,8 +130,7 @@ internal class DslJsonBodyBuilderTest {
}
}

assertThat(actualJsonBody.pactDslObject.toString())
.isEqualTo(expectedBody.pactDslObject.toString())
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
}

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

assertThat(actualJsonBody.pactDslObject.toString())
.isEqualTo(expectedBody.pactDslObject.toString())
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
}

data class ThirdProperty(val dependOnFirst: FirstProperty, val property: String)
Expand All @@ -172,8 +164,7 @@ internal class DslJsonBodyBuilderTest {
}
}

assertThat(actualJsonBody.pactDslObject.toString())
.isEqualTo(expectedBody.pactDslObject.toString())
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
}

@Test
Expand All @@ -197,8 +188,7 @@ internal class DslJsonBodyBuilderTest {
}
}

assertThat(actualJsonBody.pactDslObject.toString())
.isEqualTo(expectedBody.pactDslObject.toString())
assertThat(actualJsonBody.pactDslObject.toString(), `is`(equalTo(expectedBody.pactDslObject.toString())))
}

companion object {
Expand Down

0 comments on commit 4d7a28b

Please sign in to comment.