diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/application/Application.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/application/Application.kt index d918fc8..0457409 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/application/Application.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/desktop/application/Application.kt @@ -23,12 +23,12 @@ fun main(args: Array) { provisionDesktop(prov, cmd) } catch (e: SerializationException) { println( - "Error: File \"${cmd.configFile}\" has an invalid format and or invalid data.\n" + "Error: File \"${cmd.configFile?.fileName}\" has an invalid format and or invalid data.\n" ) } catch (e: FileNotFoundException) { println( - "Error: File\u001b[31m ${cmd.configFile} \u001b[0m was not found.\n" + - "Pls copy file \u001B[31m WorkplaceConfigExample.yaml \u001B[0m to file \u001B[31m ${cmd.configFile} \u001B[0m " + + "Error: File\u001b[31m ${cmd.configFile?.fileName} \u001b[0m was not found.\n" + + "Pls copy file \u001B[31m WorkplaceConfigExample.yaml \u001B[0m to file \u001B[31m ${cmd.configFile?.fileName} \u001B[0m " + "and change the content according to your needs.\n" ) } diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/application/CliWorkplaceKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/application/CliWorkplaceKtTest.kt index 0abd928..168a15d 100644 --- a/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/application/CliWorkplaceKtTest.kt +++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/desktop/application/CliWorkplaceKtTest.kt @@ -110,7 +110,7 @@ internal class CliWorkplaceKtTest { System.setErr(originalErr) val expectedOutput = - "Error: File\u001B[31m ConfigFileName(fileName=idontexist.yaml) \u001B[0m was not found.Pls copy file \u001B[31m WorkplaceConfigExample.yaml \u001B[0m to file \u001B[31m ConfigFileName(fileName=idontexist.yaml) \u001B[0m and change the content according to your needs." + "Error: File\u001B[31m idontexist.yaml \u001B[0m was not found.Pls copy file \u001B[31m WorkplaceConfigExample.yaml \u001B[0m to file \u001B[31m idontexist.yaml \u001B[0m and change the content according to your needs." assertEquals(expectedOutput, outContent.toString().replace("\r", "").replace("\n", "")) verify(exactly = 0) { any().provisionWorkplace(any(), any(), any(), any(), any(), ) } @@ -137,7 +137,7 @@ internal class CliWorkplaceKtTest { System.setErr(originalErr) val expectedOutput = - "Error: File \"ConfigFileName(fileName=src/test/resources/InvalidWorkplaceConfig.yaml)\" has an invalid format and or invalid data." + "Error: File \"src/test/resources/InvalidWorkplaceConfig.yaml\" has an invalid format and or invalid data." assertEquals(expectedOutput, outContent.toString().replace("\r", "").replace("\n", "")) verify(exactly = 0) { any().provisionWorkplace(any(), any(), any(), any(), any(), ) }