diff --git a/.run/test.run.xml b/.run/test.run.xml
index fa20242..f92dc9f 100644
--- a/.run/test.run.xml
+++ b/.run/test.run.xml
@@ -5,7 +5,7 @@
-
+
diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt
index 445b73b..c72e93d 100644
--- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt
+++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/ProvTest.kt
@@ -15,11 +15,11 @@ import java.io.PrintStream
internal class ProvTest {
- private fun Prov.task_returningFalse() = task {
+ private fun Prov.task_returningFalse() = taskWithResult {
ProvResult(false)
}
- private fun Prov.task_returningTrue() = task {
+ private fun Prov.task_returningTrue() = taskWithResult {
ProvResult(true)
}
@@ -30,7 +30,7 @@ internal class ProvTest {
val res = Prov.newInstance(name = "testing").cmd("echo --testing--").success
// then
- assert(res)
+ assertTrue(res)
}
@Test
@@ -49,7 +49,7 @@ internal class ProvTest {
val res = Prov.newInstance(name = "testing").sh(script).success
// then
- assert(res)
+ assertTrue(res)
}
@Test
@@ -70,7 +70,7 @@ internal class ProvTest {
val res = Prov.newInstance(name = "provs_test").sh(script, "/root", true).success
// then
- assert(res)
+ assertTrue(res)
}
@Test
@@ -86,7 +86,7 @@ internal class ProvTest {
val res = testLocal().tst_task().success
// then
- assert(res)
+ assertTrue(res)
}
@Test
@@ -101,7 +101,7 @@ internal class ProvTest {
val res = testLocal().tst_task().success
// then
- assert(res)
+ assertTrue(res)
}
@Test
@@ -116,7 +116,7 @@ internal class ProvTest {
val res = testLocal().tst_task().success
// then
- assert(!res)
+ assertFalse(res)
}
@Test
@@ -131,7 +131,7 @@ internal class ProvTest {
val res = testLocal().tst_task_all_true_mode_ALL().success
// then
- assert(res)
+ assertTrue(res)
}
// given
@@ -147,7 +147,7 @@ internal class ProvTest {
val res = testLocal().tst_task_one_false_mode_ALL().success
// then
- assert(!res)
+ assertFalse(res)
}
// given
@@ -169,7 +169,7 @@ internal class ProvTest {
val res = testLocal().tst_task_one_false_mode_ALL_nested().success
// then
- assert(!res)
+ assertFalse(res)
}
@Test
@@ -189,7 +189,7 @@ internal class ProvTest {
val res = testLocal().tst_task_one_false_mode_ALL().success
// then
- assert(!res)
+ assertFalse(res)
}
@Test
@@ -209,7 +209,7 @@ internal class ProvTest {
val res = testLocal().tst_task_failexit_outer().success
// then
- assert(!res)
+ assertFalse(res)
}
@Test
@@ -229,7 +229,7 @@ internal class ProvTest {
val res = testLocal().tst_task_failexit_outer().success
// then
- assert(res)
+ assertTrue(res)
}
@Test
@@ -254,7 +254,7 @@ internal class ProvTest {
val res = testLocal().tst_nested().success
// then
- assert(!res)
+ assertFalse(res)
}
diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/platformTest/UbuntuProvTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/platformTest/UbuntuProvTest.kt
index bca33f9..72a88bf 100644
--- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/platformTest/UbuntuProvTest.kt
+++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/platformTest/UbuntuProvTest.kt
@@ -11,8 +11,7 @@ import org.domaindrivenarchitecture.provs.test.tags.ContainerTest
import org.domaindrivenarchitecture.provs.test.tags.NonCi
import org.domaindrivenarchitecture.provs.test.testDockerWithSudo
import org.domaindrivenarchitecture.provs.test.testLocal
-import org.junit.jupiter.api.Assertions.assertEquals
-import org.junit.jupiter.api.Assertions.assertFalse
+import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
internal class UbuntuProvTest {
@@ -28,9 +27,9 @@ internal class UbuntuProvTest {
val res2 = a.cmd("echo abc", dir)
// then
- assert(res1.success)
- assert(res2.success)
- assert(res2.out?.trim() == "abc")
+ assertTrue(res1.success)
+ assertTrue(res2.success)
+ assertTrue(res2.out?.trim() == "abc")
}
@Test
@@ -43,8 +42,8 @@ internal class UbuntuProvTest {
val res1 = a.cmd("echo abc", "/root", sudo = true)
// then
- assert(res1.success)
- assert(res1.out?.trim() == "abc")
+ assertTrue(res1.success)
+ assertTrue(res1.out?.trim() == "abc")
}
@Test
@@ -58,9 +57,9 @@ internal class UbuntuProvTest {
val res2 = a.cmd("echo abc", dir)
// then
- assert(res1.success)
- assert(res2.success)
- assert(res2.out?.trim() == "abc")
+ assertTrue(res1.success)
+ assertTrue(res2.success)
+ assertTrue(res2.out?.trim() == "abc")
}
@Test
@@ -73,10 +72,10 @@ internal class UbuntuProvTest {
val res2 = a.exec("/bin/bash", "-c", "echo echoed")
// then
- assert(res1.success)
- assert(res1.out?.trim() == "hi")
- assert(res2.success)
- assert(res2.out?.trim() == "echoed")
+ assertTrue(res1.success)
+ assertTrue(res1.out?.trim() == "hi")
+ assertTrue(res2.success)
+ assertTrue(res2.out?.trim() == "echoed")
}
@Test
diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/processors/ContainerProcessorTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/processors/ContainerProcessorTest.kt
index e95c249..914cda4 100644
--- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/processors/ContainerProcessorTest.kt
+++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/processors/ContainerProcessorTest.kt
@@ -4,9 +4,8 @@ import org.domaindrivenarchitecture.provs.framework.core.newline
import org.domaindrivenarchitecture.provs.test.defaultTestContainer
import org.domaindrivenarchitecture.provs.test.tags.ContainerTest
import org.junit.jupiter.api.Assertions.assertEquals
+import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
-import org.junit.jupiter.api.condition.EnabledOnOs
-import org.junit.jupiter.api.condition.OS
internal class ContainerProcessorTest {
@@ -22,7 +21,7 @@ internal class ContainerProcessorTest {
val res = prov.cmd("echo '${text}'")
// then
- assert(res.success)
+ assertTrue(res.success)
assertEquals(text + newline(), res.out)
}
@@ -38,7 +37,7 @@ internal class ContainerProcessorTest {
val res = prov.cmdNoLog("echo '${text}'")
// then
- assert(res.success)
+ assertTrue(res.success)
assertEquals(text + newline(), res.out)
// todo add check that cmd was not logged
diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/processors/LocalProcessorTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/processors/LocalProcessorTest.kt
index eb0b191..ea5a91c 100644
--- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/processors/LocalProcessorTest.kt
+++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/core/processors/LocalProcessorTest.kt
@@ -4,8 +4,7 @@ import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.escapeAndEncloseByDoubleQuoteForShell
import org.domaindrivenarchitecture.provs.framework.core.escapeProcentForPrintf
import org.domaindrivenarchitecture.provs.framework.core.escapeSingleQuoteForShell
-import org.junit.jupiter.api.Assertions.assertEquals
-import org.junit.jupiter.api.Assertions.assertTrue
+import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
@@ -21,8 +20,8 @@ internal class LocalProcessorTest {
val res = prov.cmd("printf '${text.replace("%", "%%").escapeSingleQuoteForShell()}'")
// then
- assert(res.success)
- assert(res.out == text)
+ assertTrue(res.success)
+ assertTrue(res.out == text)
}
@@ -52,7 +51,7 @@ internal class LocalProcessorTest {
val res = prov.cmdNoLog("echo $osSpecificText")
// then
- assert(res.success)
+ assertTrue(res.success)
assertEquals( text + System.lineSeparator(), res.out)
// todo add check that cmd was not logged
@@ -68,8 +67,8 @@ internal class LocalProcessorTest {
val res = prov.cmd("iamanunknowncmd")
// then
- assert(!res.success)
- assert(res.out.isNullOrEmpty())
- assert(!res.err.isNullOrEmpty())
+ assertFalse(res.success)
+ assertTrue(res.out.isNullOrEmpty())
+ assertFalse(res.err.isNullOrEmpty())
}
}
\ No newline at end of file
diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/ProvisionKeysTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/ProvisionKeysTest.kt
index 314b98b..e81257e 100644
--- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/ProvisionKeysTest.kt
+++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/ProvisionKeysTest.kt
@@ -3,6 +3,7 @@ package org.domaindrivenarchitecture.provs.framework.ubuntu.keys
import org.domaindrivenarchitecture.provs.framework.core.Secret
import org.domaindrivenarchitecture.provs.test.defaultTestContainer
import org.domaindrivenarchitecture.provs.test.tags.NonCi
+import org.junit.jupiter.api.Assertions.assertTrue
import org.junit.jupiter.api.Test
internal class ProvisionKeysTest {
@@ -20,7 +21,7 @@ internal class ProvisionKeysTest {
)
// then
- assert(res.success)
+ assertTrue(res.success)
}
}
diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/user/ProvisionUserKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/user/ProvisionUserKtTest.kt
index 1eed989..335832a 100644
--- a/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/user/ProvisionUserKtTest.kt
+++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/user/ProvisionUserKtTest.kt
@@ -36,7 +36,7 @@ internal class ProvisionUserKtTest {
)
// then
- assert(res.success)
+ assertTrue(res.success)
}
@Test
diff --git a/src/test/kotlin/org/domaindrivenarchitecture/provs/syspec/infrastructure/VerificationKtTest.kt b/src/test/kotlin/org/domaindrivenarchitecture/provs/syspec/infrastructure/VerificationKtTest.kt
index 0d2f0e1..e1a7dec 100644
--- a/src/test/kotlin/org/domaindrivenarchitecture/provs/syspec/infrastructure/VerificationKtTest.kt
+++ b/src/test/kotlin/org/domaindrivenarchitecture/provs/syspec/infrastructure/VerificationKtTest.kt
@@ -126,9 +126,9 @@ internal class VerificationKtTest {
val res3 = testLocal().verifySocketSpec(SocketSpec("sshd", 22, running = false), out).success
// then
- assert(res.success)
- assert(!res2)
- assert(!res3)
+ assertTrue(res.success)
+ assertFalse(res2)
+ assertFalse(res3)
}
}
\ No newline at end of file