From ff51365eb80b34a973f5fe89bddd69b1c8e5ce0e Mon Sep 17 00:00:00 2001 From: Terje Heen Date: Wed, 1 Feb 2023 12:42:47 +0100 Subject: [PATCH] =?UTF-8?q?b=20Fors=C3=B8ker=20=C3=A5=20gj=C3=B8re=20Aktor?= =?UTF-8?q?IdCache-testen=20mer=20robust.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Får innimellom noen klokkeissues som jeg forsøker å skrive oss bort fra. --- .../AktorIdCacheRepositoryDbIntegrationTest.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/kotlin/no/nav/fo/veilarbregistrering/db/aktorIdCache/AktorIdCacheRepositoryDbIntegrationTest.kt b/src/test/kotlin/no/nav/fo/veilarbregistrering/db/aktorIdCache/AktorIdCacheRepositoryDbIntegrationTest.kt index daa380352..987a54247 100644 --- a/src/test/kotlin/no/nav/fo/veilarbregistrering/db/aktorIdCache/AktorIdCacheRepositoryDbIntegrationTest.kt +++ b/src/test/kotlin/no/nav/fo/veilarbregistrering/db/aktorIdCache/AktorIdCacheRepositoryDbIntegrationTest.kt @@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase import org.springframework.boot.test.autoconfigure.jdbc.JdbcTest import org.springframework.test.context.ContextConfiguration +import java.time.LocalDate import java.time.LocalDateTime import java.time.temporal.ChronoUnit import kotlin.test.assertEquals @@ -31,7 +32,7 @@ class AktorIdCacheRepositoryDbIntegrationTest( val FOEDSELSNUMMER = Foedselsnummer("01234567890") val AKTORID = AktorId("1000010000100") - aktorIdCacheRepository.lagre(AktorIdCache(FOEDSELSNUMMER, AKTORID, LocalDateTime.now())) + aktorIdCacheRepository.lagre(AktorIdCache(FOEDSELSNUMMER, AKTORID, LocalDate.now().atStartOfDay())) val aktorIdCache = aktorIdCacheRepository.hentAktørId(FOEDSELSNUMMER) assertNotNull(aktorIdCache) @@ -47,8 +48,8 @@ class AktorIdCacheRepositoryDbIntegrationTest( @Test fun `ikke gjøre endring ved insetting av eksisterende bruker`(){ - val opprettetDatoOriginal = LocalDateTime.now().minusDays(1) - val opprettetDatoNy = LocalDateTime.now() + val opprettetDatoOriginal = LocalDate.now().atStartOfDay().minusDays(1) + val opprettetDatoNy = LocalDate.now().atStartOfDay() val FOEDSELSNUMMER = Foedselsnummer("01234567890") val AKTORID = AktorId("1000010000100")