From 8e5d2798c04d0733c0f1b50f8709fa607af35164 Mon Sep 17 00:00:00 2001 From: Niko Pitkonen Date: Wed, 30 Aug 2023 10:02:50 +0300 Subject: [PATCH] HAI-1844 Add test to verify no hanke kayttajas are created if no perustaja or contacts --- .../kotlin/fi/hel/haitaton/hanke/HankeServiceITests.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/hanke-service/src/integrationTest/kotlin/fi/hel/haitaton/hanke/HankeServiceITests.kt b/services/hanke-service/src/integrationTest/kotlin/fi/hel/haitaton/hanke/HankeServiceITests.kt index 9229ab461..8e1061ef5 100644 --- a/services/hanke-service/src/integrationTest/kotlin/fi/hel/haitaton/hanke/HankeServiceITests.kt +++ b/services/hanke-service/src/integrationTest/kotlin/fi/hel/haitaton/hanke/HankeServiceITests.kt @@ -214,6 +214,14 @@ class HankeServiceITests : DatabaseTest() { assertThat(kayttajaTunnisteRepository.findAll()).hasSize(4) } + @Test + fun `create Hanke with without perustaja and contacts does not create hanke users`() { + hankeService.createHanke(getATestHanke()) + + assertThat(hankeKayttajaRepository.findAll()).isEmpty() + assertThat(kayttajaTunnisteRepository.findAll()).isEmpty() + } + @Test fun `create Hanke with partial data set and update with full data set give correct status`() { // Setup Hanke (without any yhteystieto):