aboutsummaryrefslogtreecommitdiffstats
path: root/utils-test
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2021-09-10 15:48:31 +0100
committerliamfallon <liam.fallon@est.tech>2021-09-13 09:05:48 +0100
commit6a48e567dd487780ae34334836c7949d46a3f3ea (patch)
tree1e91dec1248770990f166c8805e1041cbca2e1ed /utils-test
parentb6b7479a46b0d8ac3ae8741554d1085fb9e4a7fe (diff)
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 <liam.fallon@est.tech>
Diffstat (limited to 'utils-test')
-rw-r--r--utils-test/src/test/java/org/onap/policy/common/utils/security/SelfSignedKeyStoreTest.java4
1 files changed, 2 insertions, 2 deletions
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) {