From 082e3e76ed3d94d526d36e4e028c7edb08eb3eb0 Mon Sep 17 00:00:00 2001 From: IBA-mainframe-dev Date: Thu, 23 May 2024 18:44:20 +0200 Subject: [PATCH] Test fix --- .../org/zowe/zdevops/classic/steps/WriteFileToFileStep.kt | 2 +- .../zowe/zdevops/classic/steps/WriteFileToDatasetStepSpec.kt | 3 +-- .../org/zowe/zdevops/classic/steps/WriteFileToFileStepSpec.kt | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/org/zowe/zdevops/classic/steps/WriteFileToFileStep.kt b/src/main/kotlin/org/zowe/zdevops/classic/steps/WriteFileToFileStep.kt index 7e5dcf5..1f7b427 100644 --- a/src/main/kotlin/org/zowe/zdevops/classic/steps/WriteFileToFileStep.kt +++ b/src/main/kotlin/org/zowe/zdevops/classic/steps/WriteFileToFileStep.kt @@ -57,7 +57,7 @@ constructor( val file = when (fileOption) { DescriptorImpl().localFileOption -> localFilePath?.let { File(it) } DescriptorImpl().workspaceFileOption -> { - val fileWorkspacePath = workspace?.remote + '\\' + workspacePath + val fileWorkspacePath = workspace?.remote + File.separator + workspacePath File(fileWorkspacePath) } else -> throw AbortException(Messages.zdevops_classic_write_options_invalid()) diff --git a/src/test/kotlin/org/zowe/zdevops/classic/steps/WriteFileToDatasetStepSpec.kt b/src/test/kotlin/org/zowe/zdevops/classic/steps/WriteFileToDatasetStepSpec.kt index 6ea4b19..65517ac 100644 --- a/src/test/kotlin/org/zowe/zdevops/classic/steps/WriteFileToDatasetStepSpec.kt +++ b/src/test/kotlin/org/zowe/zdevops/classic/steps/WriteFileToDatasetStepSpec.kt @@ -49,7 +49,6 @@ class WriteFileToDatasetStepSpec : ShouldSpec({ val zosConnection = ZOSConnection(mockServer.hostName, mockServer.port.toString(), "test", "test", "https") val rootDir = Paths.get("").toAbsolutePath().toString() val trashDir = tempdir() - val mockDir = Paths.get(rootDir, "src", "test", "resources", "mock").toString() val itemGroup = object : TestItemGroup() { override fun getRootDirFor(child: Item?): File { return trashDir @@ -98,7 +97,7 @@ class WriteFileToDatasetStepSpec : ShouldSpec({ val writeFileToDatasetDecl = spyk( WriteFileToDatasetStep("test", "TEST.IJMP.DATASET1", "workspace") ) - writeFileToDatasetDecl.setLocalFilePath(mockDir + "/test_file.txt") + writeFileToDatasetDecl.setWorkspacePath("test_file.txt") writeFileToDatasetDecl.perform( build, launcher, diff --git a/src/test/kotlin/org/zowe/zdevops/classic/steps/WriteFileToFileStepSpec.kt b/src/test/kotlin/org/zowe/zdevops/classic/steps/WriteFileToFileStepSpec.kt index 4a5433d..18e3843 100644 --- a/src/test/kotlin/org/zowe/zdevops/classic/steps/WriteFileToFileStepSpec.kt +++ b/src/test/kotlin/org/zowe/zdevops/classic/steps/WriteFileToFileStepSpec.kt @@ -50,7 +50,6 @@ class WriteFileToFileStepSpec : ShouldSpec({ val zosConnection = ZOSConnection(mockServer.hostName, mockServer.port.toString(), "test", "test", "https") val rootDir = Paths.get("").toAbsolutePath().toString() val trashDir = tempdir() - val mockDir = Paths.get(rootDir, "src", "test", "resources", "mock").toString() val itemGroup = object : TestItemGroup() { override fun getRootDirFor(child: Item?): File { return trashDir @@ -99,7 +98,7 @@ class WriteFileToFileStepSpec : ShouldSpec({ val writeFileToFileDecl = spyk( WriteFileToFileStep("test", "/u/TEST/test.txt", false, "workspace") ) - writeFileToFileDecl.setLocalFilePath(mockDir + "/test_file.txt") + writeFileToFileDecl.setWorkspacePath("test_file.txt") writeFileToFileDecl.perform( build, launcher,