Add UUIDAssert
This commit is contained in:
@@ -16,6 +16,7 @@ dependencies {
|
||||
runtimeOnly(hlaeja.org.postgresql)
|
||||
runtimeOnly(hlaeja.org.postgresql.r2dbc)
|
||||
|
||||
testImplementation(hlaeja.assertj.core)
|
||||
testImplementation(hlaeja.io.mockk)
|
||||
testImplementation(hlaeja.io.projectreactor.reactor.test)
|
||||
testImplementation(hlaeja.kotlin.test.junit5)
|
||||
|
||||
15
src/test/kotlin/ltd/hlaeja/assertj/UUIDAssert.kt
Normal file
15
src/test/kotlin/ltd/hlaeja/assertj/UUIDAssert.kt
Normal file
@@ -0,0 +1,15 @@
|
||||
package ltd.hlaeja.assertj
|
||||
|
||||
import java.util.UUID
|
||||
import org.assertj.core.api.AbstractAssert
|
||||
|
||||
class UUIDAssert(actual: UUID) : AbstractAssert<UUIDAssert, UUID>(actual, UUIDAssert::class.java) {
|
||||
fun isUUID(expected: String): UUIDAssert {
|
||||
objects.assertEqual(this.info, this.actual, UUID.fromString(expected))
|
||||
return this.myself
|
||||
}
|
||||
}
|
||||
|
||||
fun assertThat(actual: UUID): UUIDAssert {
|
||||
return UUIDAssert(actual)
|
||||
}
|
||||
Reference in New Issue
Block a user