You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by co...@apache.org on 2018/07/03 10:35:31 UTC

[camel] branch master updated: Fixing KeystoreParametersTest with Java 10

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 6dd826d  Fixing KeystoreParametersTest with Java 10
6dd826d is described below

commit 6dd826d0db9193d1575d0c8a3647c6746c420439
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Tue Jul 3 11:35:09 2018 +0100

    Fixing KeystoreParametersTest with Java 10
---
 .../apache/camel/util/jsse/KeyStoreParametersTest.java    | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/camel-core/src/test/java/org/apache/camel/util/jsse/KeyStoreParametersTest.java b/camel-core/src/test/java/org/apache/camel/util/jsse/KeyStoreParametersTest.java
index f5c118a..04b4912 100644
--- a/camel-core/src/test/java/org/apache/camel/util/jsse/KeyStoreParametersTest.java
+++ b/camel-core/src/test/java/org/apache/camel/util/jsse/KeyStoreParametersTest.java
@@ -22,6 +22,7 @@ import java.net.URISyntaxException;
 import java.net.URL;
 import java.security.GeneralSecurityException;
 import java.security.KeyStore;
+import java.security.KeyStoreException;
 import java.security.NoSuchProviderException;
 
 import org.apache.camel.CamelContext;
@@ -102,12 +103,22 @@ public class KeyStoreParametersTest extends AbstractJsseParametersTest {
     }
     
     public void testExplicitInvalidType() throws Exception {
-        if (getJavaMajorVersion() == 9) {
+    	KeyStoreParameters ksp = this.createMinimalKeyStoreParameters();
+        ksp.setType("1234");
+        
+        try {
+            ksp.createKeyStore();
+            fail();
+        } catch (KeyStoreException e) {
+            // expected
+        }
+        
+        if (getJavaMajorVersion() >= 9) {
             //checkout http://openjdk.java.net/jeps/229
             return;
         }
         
-        KeyStoreParameters ksp = this.createMinimalKeyStoreParameters();
+        ksp = this.createMinimalKeyStoreParameters();
         ksp.setType("pkcs12");
         
         try {