You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/09/27 12:07:08 UTC
[camel] 04/16: CAMEL-13998 - Unit tests
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 00ae596428e4a9cd60711644013289ede2789841
Author: marius cornescu <ma...@yahoo.com>
AuthorDate: Thu Sep 19 22:11:19 2019 +0200
CAMEL-13998 - Unit tests
---
.../hdfs/kerberos/KerberosConfigurationTest.java | 35 +++++++++++-----------
.../src/test/resources/kerberos/test-keytab.bin | 1 +
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/kerberos/KerberosConfigurationTest.java b/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/kerberos/KerberosConfigurationTest.java
index 820dfba..6e9788a 100644
--- a/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/kerberos/KerberosConfigurationTest.java
+++ b/components/camel-hdfs/src/test/java/org/apache/camel/component/hdfs/kerberos/KerberosConfigurationTest.java
@@ -53,24 +53,23 @@ public class KerberosConfigurationTest {
/* exception was thrown */
}
-// @Test
-// public void loginWithKeytab() {
-// // given
-// List<String> namedNodes;
-// String kerberosConfigFileLocation;
-// int replicationFactor;
-//
-// String username;
-// String keyTabFileLocation;
-//
-// underTest = new KerberosConfiguration(namedNodes, kerberosConfigFileLocation, replicationFactor);
-//
-// // when
-// underTest.loginWithKeytab(username, keyTabFileLocation);
-//
-// // then
-//
-// }
+ @Test
+ public void loginWithKeytab() throws IOException {
+ // given
+ List<String> namedNodes = Arrays.asList("kerb_node_01.example.com:8021", "kerb_node_02.example.com:8022");
+ String kerberosConfigFileLocation = pwd() + "/src/test/resources/kerberos/test-kerb5.conf";
+ int replicationFactor = 3;
+ underTest = new KerberosConfiguration(namedNodes, kerberosConfigFileLocation, replicationFactor);
+
+ String username = "test_user";
+ String keyTabFileLocation = pwd() + "/src/test/resources/kerberos/test-keytab.bin";
+
+ // when
+ underTest.loginWithKeytab(username, keyTabFileLocation);
+
+ // then
+
+ }
private String pwd() {
return new File(".").getAbsolutePath();
diff --git a/components/camel-hdfs/src/test/resources/kerberos/test-keytab.bin b/components/camel-hdfs/src/test/resources/kerberos/test-keytab.bin
new file mode 100644
index 0000000..caa12a8
--- /dev/null
+++ b/components/camel-hdfs/src/test/resources/kerberos/test-keytab.bin
@@ -0,0 +1 @@
+example.com
\ No newline at end of file