From 0659a98532a0fca8973454bd2e4b99c49c96a235 Mon Sep 17 00:00:00 2001 From: az Date: Fri, 17 Jun 2022 13:22:00 +0200 Subject: [PATCH] add test provisionDesktop_fails_for_unknown_DesktopType --- .../desktop/domain/DesktopServiceKtTest.kt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopServiceKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopServiceKtTest.kt index d067320..a619a89 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopServiceKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/domain/DesktopServiceKtTest.kt @@ -2,11 +2,32 @@ package org.domaindrivenarchitecture.provs.desktop.domain import org.domaindrivenarchitecture.provs.desktop.infrastructure.getConfig import org.domaindrivenarchitecture.provs.test.defaultTestContainer +import org.domaindrivenarchitecture.provs.test.tags.ContainerTest import org.domaindrivenarchitecture.provs.test.tags.ExtensiveContainerTest +import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.assertThrows internal class DesktopServiceKtTest { + @ContainerTest + fun provisionDesktop_fails_for_unknown_DesktopType() { + // given + val prov = defaultTestContainer() + + // when + val exception = assertThrows { + prov.provisionDesktop( + DesktopType("iamunkown"), + gitUserName = "testuser", + gitEmail = "testuser@test.org", + ) + } + + // then + assertEquals("No DesktopType found for value: iamunkown", exception.message) + } + @ExtensiveContainerTest fun provisionDesktop() { // given