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

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