+ @Test
+ public void testValidationExceptionCertificatePassword() throws Exception {
+ try {
+ createDispatcherInstance(1, createTls(null, KEYSTORE, STORE_PASSWORD, PathType.PATH, StoreType.JKS, TRUSTSTORE, STORE_PASSWORD,
+ PathType.PATH, StoreType.JKS));
+ fail();
+ } catch (final ValidationException e) {
+ assertTrue(e.getMessage().contains("certificate password"));
+ }
+ }
+
+ @Test
+ public void testValidationExceptionKeystoreLocation() throws Exception {
+ try {
+ createDispatcherInstance(1, createTls(STORE_PASSWORD, null, STORE_PASSWORD, PathType.PATH, StoreType.JKS, TRUSTSTORE, STORE_PASSWORD,
+ PathType.PATH, StoreType.JKS));
+ fail();
+ } catch (final ValidationException e) {
+ assertTrue(e.getMessage().contains("keystore location"));
+ }
+ }
+
+ @Test
+ public void testValidationExceptionKeystorePassword() throws Exception {
+ try {
+ createDispatcherInstance(1, createTls(STORE_PASSWORD, KEYSTORE, null, PathType.PATH, StoreType.JKS, TRUSTSTORE, STORE_PASSWORD,
+ PathType.PATH, StoreType.JKS));
+ fail();
+ } catch (final ValidationException e) {
+ assertTrue(e.getMessage().contains("keystore password"));
+ }
+ }
+
+ @Test
+ public void testValidationExceptionKeystorePathType() throws Exception {
+ try {
+ createDispatcherInstance(1, createTls(STORE_PASSWORD, KEYSTORE, STORE_PASSWORD, null, StoreType.JKS, TRUSTSTORE, STORE_PASSWORD,
+ PathType.PATH, StoreType.JKS));
+ fail();
+ } catch (final ValidationException e) {
+ assertTrue(e.getMessage().contains("keystore path type"));
+ }
+ }
+
+ @Test
+ public void testValidationExceptionKeystoreType() throws Exception {
+ try {
+ createDispatcherInstance(1, createTls(STORE_PASSWORD, KEYSTORE, STORE_PASSWORD, PathType.PATH, null, TRUSTSTORE, STORE_PASSWORD,
+ PathType.PATH, StoreType.JKS));
+ fail();
+ } catch (final ValidationException e) {
+ assertTrue(e.getMessage().contains("keystore type"));
+ }
+ }
+
+ @Test
+ public void testValidationExceptionTruststoreLocation() throws Exception {
+ try {
+ createDispatcherInstance(1, createTls(STORE_PASSWORD, KEYSTORE, STORE_PASSWORD, PathType.PATH, StoreType.JKS, null, STORE_PASSWORD,
+ PathType.PATH, StoreType.JKS));
+ fail();
+ } catch (final ValidationException e) {
+ assertTrue(e.getMessage().contains("truststore location"));
+ }
+ }
+
+ @Test
+ public void testValidationExceptionTruststorePassword() throws Exception {
+ try {
+ createDispatcherInstance(1, createTls(STORE_PASSWORD, KEYSTORE, STORE_PASSWORD, PathType.PATH, StoreType.JKS, TRUSTSTORE, null,
+ PathType.PATH, StoreType.JKS));
+ fail();
+ } catch (final ValidationException e) {
+ assertTrue(e.getMessage().contains("truststore password"));
+ }
+ }
+
+ @Test
+ public void testValidationExceptionTruststorePathType() throws Exception {
+ try {
+ createDispatcherInstance(1, createTls(STORE_PASSWORD, KEYSTORE, STORE_PASSWORD, PathType.PATH, StoreType.JKS, TRUSTSTORE, STORE_PASSWORD,
+ null, StoreType.JKS));
+ fail();
+ } catch (final ValidationException e) {
+ assertTrue(e.getMessage().contains("truststore path type"));
+ }
+ }
+
+ @Test
+ public void testValidationExceptionTruststoreType() throws Exception {
+ try {
+ createDispatcherInstance(1, createTls(STORE_PASSWORD, KEYSTORE, STORE_PASSWORD, PathType.PATH, StoreType.JKS, TRUSTSTORE, STORE_PASSWORD,
+ PathType.PATH, null));
+ fail();
+ } catch (final ValidationException e) {
+ assertTrue(e.getMessage().contains("truststore type"));
+ }
+ }
+