Update PatientRepositoryTest.kt

This commit is contained in:
2026-10-09 10:01:32 +02:00
parent dcfa11bef9
commit 26cc81388e
@@ -77,7 +77,8 @@ class PatientRepositoryTest {
assertEquals("0123 456789", loaded.phone1)
assertEquals("0987 654321", loaded.phone2)
assertNull(loaded.phone3)
assertEquals(saved.createdAt, loaded.createdAt)
// Die Datenbank speichert Millisekunden, upsert() liefert Instant.now() mit höherer Genauigkeit.
assertEquals(saved.createdAt.toEpochMilli(), loaded.createdAt.toEpochMilli())
}
@Test
@@ -87,11 +88,11 @@ class PatientRepositoryTest {
// createdAt im übergebenen Objekt wird bewusst ignoriert (Instant.EPOCH aus dem Helper).
val second = repo.upsert(patient(lastName = "Musterfrau"))
assertEquals(first.createdAt, second.createdAt)
assertTrue(second.updatedAt >= first.updatedAt)
assertEquals(first.createdAt.toEpochMilli(), second.createdAt.toEpochMilli())
assertTrue(second.updatedAt.toEpochMilli() >= first.updatedAt.toEpochMilli())
val loaded = repo.getById("p-1")!!
assertEquals("Musterfrau", loaded.lastName)
assertEquals(first.createdAt, loaded.createdAt)
assertEquals(first.createdAt.toEpochMilli(), loaded.createdAt.toEpochMilli())
}
@Test