From 6a48e567dd487780ae34334836c7949d46a3f3ea Mon Sep 17 00:00:00 2001 From: liamfallon Date: Fri, 10 Sep 2021 15:48:31 +0100 Subject: Fix test failure in staging job The "keytool" program does not exist in the Jenkins staging job environment, so the test case that checks for a keytool error message fails because an unexpected error message is received. By changing the test case to expect "keytool" rather than "keytool exited with", then the test will pass when the error message "Cannot run program "keytool": error=2, No such file or directory" is returned. Issue-ID: POLICY-3587 Change-Id: I3a6b77fb571cfbf170f5f16bf93eece2d78a7bbb Signed-off-by: liamfallon --- .../org/onap/policy/common/utils/security/SelfSignedKeyStoreTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils-test') diff --git a/utils-test/src/test/java/org/onap/policy/common/utils/security/SelfSignedKeyStoreTest.java b/utils-test/src/test/java/org/onap/policy/common/utils/security/SelfSignedKeyStoreTest.java index 62565bde..2c420225 100644 --- a/utils-test/src/test/java/org/onap/policy/common/utils/security/SelfSignedKeyStoreTest.java +++ b/utils-test/src/test/java/org/onap/policy/common/utils/security/SelfSignedKeyStoreTest.java @@ -123,7 +123,7 @@ public class SelfSignedKeyStoreTest { @Test public void testSelfSignedKeyStoreStringKeytoolFailure() throws Exception { assertThatThrownBy(() -> new SelfSignedKeyStore("target/unknown/path/to/keystore")) - .isInstanceOf(IOException.class).hasMessageContaining("keytool exited with"); + .isInstanceOf(IOException.class).hasMessageContaining("keytool"); } @Test @@ -141,7 +141,7 @@ public class SelfSignedKeyStoreTest { // try again using the original relative path - should fail, as it's now deeper assertThatThrownBy(() -> new SelfSignedKeyStore(relpath)).isInstanceOf(IOException.class) - .hasMessageContaining("keytool exited with"); + .hasMessageContaining("keytool"); } private static void delete(File file) { -- cgit 1.2.3-korg