Skip to content

Commit

Permalink
Improve keystore exception message when keystore is not valid (#4759)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Mayer <michael@schnittstabil.de>
  • Loading branch information
schnittstabil authored Apr 8, 2020
1 parent 3981ec1 commit a640701
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static KeyStore getKeyStore(Resource store, String storeType, String stor
}

if (!store.exists())
throw new IllegalStateException("no valid keystore");
throw new IllegalStateException(store.getName() + " is not a valid keystore");

try (InputStream inStream = store.getInputStream())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public void testNoKeyConfig()
cf.setTrustStorePath("/foo");
cf.start();
});
assertThat(x.getMessage(), containsString("no valid keystore"));
assertThat(x.getMessage(), equalTo("/foo is not a valid keystore"));
}
}

Expand Down

0 comments on commit a640701

Please sign in to comment.