Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.hadoop.hbase.io.crypto.tls;

import java.io.File;
import java.io.IOException;
import java.security.Security;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -104,7 +103,7 @@ public static void cleanUpBaseClass() {
}

@BeforeEach
public void setUp() throws IOException {
public void setUp() throws Exception {
x509TestContext = PROVIDER.get(caKeyType, certKeyType, keyPassword);
x509TestContext.setConfigurations(KeyStoreFileType.JKS, KeyStoreFileType.JKS);
conf = new Configuration(UTIL.getConfiguration());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testLoadKeyStore() throws Exception {
}

@TestTemplate
public void testLoadKeyStoreWithWrongPassword() throws IOException {
public void testLoadKeyStoreWithWrongPassword() throws Exception {
String path = x509TestContext.getKeyStoreFile(KeyStoreFileType.BCFKS).getAbsolutePath();
assertThrows(IOException.class, () -> {
new BCFKSFileLoader.Builder().setKeyStorePath(path)
Expand All @@ -61,7 +61,7 @@ public void testLoadKeyStoreWithWrongPassword() throws IOException {
}

@TestTemplate
public void testLoadKeyStoreWithWrongFilePath() throws IOException {
public void testLoadKeyStoreWithWrongFilePath() throws Exception {
String path = x509TestContext.getKeyStoreFile(KeyStoreFileType.BCFKS).getAbsolutePath();
assertThrows(IOException.class, () -> {
new BCFKSFileLoader.Builder().setKeyStorePath(path + ".does_not_exist")
Expand All @@ -78,7 +78,7 @@ public void testLoadKeyStoreWithNullFilePath() {
}

@TestTemplate
public void testLoadKeyStoreWithWrongFileType() throws IOException {
public void testLoadKeyStoreWithWrongFileType() throws Exception {
String path = x509TestContext.getKeyStoreFile(KeyStoreFileType.PEM).getAbsolutePath();
assertThrows(IOException.class, () -> {
// Trying to load a PEM file with BCFKS loader should fail
Expand All @@ -96,7 +96,7 @@ public void testLoadTrustStore() throws Exception {
}

@TestTemplate
public void testLoadTrustStoreWithWrongPassword() throws IOException {
public void testLoadTrustStoreWithWrongPassword() throws Exception {
String path = x509TestContext.getTrustStoreFile(KeyStoreFileType.BCFKS).getAbsolutePath();
assertThrows(IOException.class, () -> {

Expand All @@ -106,7 +106,7 @@ public void testLoadTrustStoreWithWrongPassword() throws IOException {
}

@TestTemplate
public void testLoadTrustStoreWithWrongFilePath() throws IOException {
public void testLoadTrustStoreWithWrongFilePath() throws Exception {
String path = x509TestContext.getTrustStoreFile(KeyStoreFileType.BCFKS).getAbsolutePath();
assertThrows(IOException.class, () -> {
new BCFKSFileLoader.Builder().setTrustStorePath(path + ".does_not_exist")
Expand All @@ -123,7 +123,7 @@ public void testLoadTrustStoreWithNullFilePath() {
}

@TestTemplate
public void testLoadTrustStoreWithWrongFileType() throws IOException {
public void testLoadTrustStoreWithWrongFileType() throws Exception {
String path = x509TestContext.getTrustStoreFile(KeyStoreFileType.PEM).getAbsolutePath();
assertThrows(IOException.class, () -> {
// Trying to load a PEM file with BCFKS loader should fail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testLoadKeyStore() throws Exception {
}

@TestTemplate
public void testLoadKeyStoreWithWrongPassword() throws IOException {
public void testLoadKeyStoreWithWrongPassword() throws Exception {
String path = x509TestContext.getKeyStoreFile(KeyStoreFileType.JKS).getAbsolutePath();
assertThrows(IOException.class, () -> {
new JKSFileLoader.Builder().setKeyStorePath(path)
Expand All @@ -61,7 +61,7 @@ public void testLoadKeyStoreWithWrongPassword() throws IOException {
}

@TestTemplate
public void testLoadKeyStoreWithWrongFilePath() throws IOException {
public void testLoadKeyStoreWithWrongFilePath() throws Exception {
String path = x509TestContext.getKeyStoreFile(KeyStoreFileType.JKS).getAbsolutePath();
assertThrows(IOException.class, () -> {
new JKSFileLoader.Builder().setKeyStorePath(path + ".does_not_exist")
Expand All @@ -78,7 +78,7 @@ public void testLoadKeyStoreWithNullFilePath() {
}

@TestTemplate
public void testLoadKeyStoreWithWrongFileType() throws IOException {
public void testLoadKeyStoreWithWrongFileType() throws Exception {
String path = x509TestContext.getKeyStoreFile(KeyStoreFileType.PEM).getAbsolutePath();
assertThrows(IOException.class, () -> {
// Trying to load a PEM file with JKS loader should fail
Expand All @@ -96,7 +96,7 @@ public void testLoadTrustStore() throws Exception {
}

@TestTemplate
public void testLoadTrustStoreWithWrongPassword() throws IOException {
public void testLoadTrustStoreWithWrongPassword() throws Exception {
String path = x509TestContext.getTrustStoreFile(KeyStoreFileType.JKS).getAbsolutePath();
assertThrows(IOException.class, () -> {
new JKSFileLoader.Builder().setTrustStorePath(path)
Expand All @@ -105,7 +105,7 @@ public void testLoadTrustStoreWithWrongPassword() throws IOException {
}

@TestTemplate
public void testLoadTrustStoreWithWrongFilePath() throws IOException {
public void testLoadTrustStoreWithWrongFilePath() throws Exception {
String path = x509TestContext.getTrustStoreFile(KeyStoreFileType.JKS).getAbsolutePath();
assertThrows(IOException.class, () -> {
new JKSFileLoader.Builder().setTrustStorePath(path + ".does_not_exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void testLoadKeyStore() throws Exception {
}

@TestTemplate
public void testLoadKeyStoreWithWrongPassword() throws IOException {
public void testLoadKeyStoreWithWrongPassword() throws Exception {
String path = x509TestContext.getKeyStoreFile(KeyStoreFileType.PEM).getAbsolutePath();
assertThrows(Exception.class, () -> {
new PEMFileLoader.Builder().setKeyStorePath(path)
Expand All @@ -62,7 +62,7 @@ public void testLoadKeyStoreWithWrongPassword() throws IOException {
}

@TestTemplate
public void testLoadKeyStoreWithWrongFilePath() throws IOException {
public void testLoadKeyStoreWithWrongFilePath() throws Exception {
String path = x509TestContext.getKeyStoreFile(KeyStoreFileType.PEM).getAbsolutePath();
assertThrows(IOException.class, () -> {
new PEMFileLoader.Builder().setKeyStorePath(path + ".does_not_exist")
Expand All @@ -79,7 +79,7 @@ public void testLoadKeyStoreWithNullFilePath() {
}

@TestTemplate
public void testLoadKeyStoreWithWrongFileType() throws IOException {
public void testLoadKeyStoreWithWrongFileType() throws Exception {
String path = x509TestContext.getKeyStoreFile(KeyStoreFileType.JKS).getAbsolutePath();
assertThrows(KeyStoreException.class, () -> {
// Trying to load a JKS file with PEM loader should fail
Expand All @@ -97,7 +97,7 @@ public void testLoadTrustStore() throws Exception {
}

@TestTemplate
public void testLoadTrustStoreWithWrongFilePath() throws IOException {
public void testLoadTrustStoreWithWrongFilePath() throws Exception {
String path = x509TestContext.getTrustStoreFile(KeyStoreFileType.PEM).getAbsolutePath();
assertThrows(IOException.class, () -> {
new PEMFileLoader.Builder().setTrustStorePath(path + ".does_not_exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testLoadKeyStore() throws Exception {
}

@TestTemplate
public void testLoadKeyStoreWithWrongPassword() throws IOException {
public void testLoadKeyStoreWithWrongPassword() throws Exception {
String path = x509TestContext.getKeyStoreFile(KeyStoreFileType.PKCS12).getAbsolutePath();
assertThrows(IOException.class, () -> {
new PKCS12FileLoader.Builder().setKeyStorePath(path)
Expand All @@ -61,7 +61,7 @@ public void testLoadKeyStoreWithWrongPassword() throws IOException {
}

@TestTemplate
public void testLoadKeyStoreWithWrongFilePath() throws IOException {
public void testLoadKeyStoreWithWrongFilePath() throws Exception {
String path = x509TestContext.getKeyStoreFile(KeyStoreFileType.PKCS12).getAbsolutePath();
assertThrows(IOException.class, () -> {
new PKCS12FileLoader.Builder().setKeyStorePath(path + ".does_not_exist")
Expand All @@ -78,7 +78,7 @@ public void testLoadKeyStoreWithNullFilePath() {
}

@TestTemplate
public void testLoadKeyStoreWithWrongFileType() throws IOException {
public void testLoadKeyStoreWithWrongFileType() throws Exception {
String path = x509TestContext.getKeyStoreFile(KeyStoreFileType.PEM).getAbsolutePath();
assertThrows(IOException.class, () -> {
// Trying to load a PEM file with PKCS12 loader should fail
Expand All @@ -96,7 +96,7 @@ public void testLoadTrustStore() throws Exception {
}

@TestTemplate
public void testLoadTrustStoreWithWrongPassword() throws IOException {
public void testLoadTrustStoreWithWrongPassword() throws Exception {
String path = x509TestContext.getTrustStoreFile(KeyStoreFileType.PKCS12).getAbsolutePath();
assertThrows(IOException.class, () -> {
new PKCS12FileLoader.Builder().setTrustStorePath(path)
Expand All @@ -105,7 +105,7 @@ public void testLoadTrustStoreWithWrongPassword() throws IOException {
}

@TestTemplate
public void testLoadTrustStoreWithWrongFilePath() throws IOException {
public void testLoadTrustStoreWithWrongFilePath() throws Exception {
String path = x509TestContext.getTrustStoreFile(KeyStoreFileType.PKCS12).getAbsolutePath();
assertThrows(IOException.class, () -> {
new PKCS12FileLoader.Builder().setTrustStorePath(path + ".does_not_exist")
Expand Down
Loading
Loading