From 624ccd8c8fa11da76b1e0f81cc35926cddfeda91 Mon Sep 17 00:00:00 2001 From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de> Date: Sat, 1 May 2021 20:08:09 +0200 Subject: [PATCH] fix test --- .../test/kotlin/theodolite/util/IOHandlerTest.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/theodolite-quarkus/src/test/kotlin/theodolite/util/IOHandlerTest.kt b/theodolite-quarkus/src/test/kotlin/theodolite/util/IOHandlerTest.kt index 88207e765..062994df5 100644 --- a/theodolite-quarkus/src/test/kotlin/theodolite/util/IOHandlerTest.kt +++ b/theodolite-quarkus/src/test/kotlin/theodolite/util/IOHandlerTest.kt @@ -6,6 +6,7 @@ import org.hamcrest.CoreMatchers.containsString import org.hamcrest.MatcherAssert.assertThat import org.junit.Rule import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test import org.junit.rules.TemporaryFolder import org.junitpioneer.jupiter.ClearEnvironmentVariable @@ -91,15 +92,18 @@ internal class IOHandlerTest { @Test() @SetEnvironmentVariable.SetEnvironmentVariables( - SetEnvironmentVariable(key = "RESULTS_FOLDER", value = FOLDER_URL), + SetEnvironmentVariable(key = "RESULTS_FOLDER", value = "$FOLDER_URL-0"), SetEnvironmentVariable(key = "CREATE_RESULTS_FOLDER", value = "false") ) fun testGetResultFolderURL_FolderNotExist() { - try { - IOHandler().getResultFolderURL() - } catch (e: Exception){ - assertThat(e.toString(), containsString("Folder not found")); - } + var exceptionWasThrown = false + try { + IOHandler().getResultFolderURL() + } catch (e: Exception){ + exceptionWasThrown = true + assertThat(e.toString(), containsString("Result folder not found")); + } + assertTrue(exceptionWasThrown) } @Test() -- GitLab