Add UUIDAssert

This commit is contained in:
2024-11-23 01:05:10 +01:00
parent 34d1b40138
commit 3e1e5663b5
2 changed files with 16 additions and 0 deletions

View File

@@ -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)

View 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)
}