aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasgar <sammoham@in.ibm.com>2018-09-27 19:54:29 +0530
committerasgar <sammoham@in.ibm.com>2018-09-27 19:54:35 +0530
commitea2aecd64138743183bd33217ce915b0ebd1c6e6 (patch)
treea9ffcbecc0203ad4be28d41057fee520a25fa800
parent64d7ded68eff8bad00d2a379e23b7a8118224c23 (diff)
added couple of cases for ValidatorUtil.java
Change-Id: I9be3ab9ef2b745c3b2fc54ff73a780fec176ec40 Issue-ID: DMAAP-809 Signed-off-by: Mohamed Asgar Samiulla <sammoham@in.ibm.com>
-rw-r--r--src/test/java/com/att/nsa/mr/tools/ValidatorUtilTest.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/test/java/com/att/nsa/mr/tools/ValidatorUtilTest.java b/src/test/java/com/att/nsa/mr/tools/ValidatorUtilTest.java
index 9317375..b50ddc4 100644
--- a/src/test/java/com/att/nsa/mr/tools/ValidatorUtilTest.java
+++ b/src/test/java/com/att/nsa/mr/tools/ValidatorUtilTest.java
@@ -165,6 +165,43 @@ public class ValidatorUtilTest {
}
+ @Test
+ public void testValidateForNonDME2WithAuthKey() {
+ Properties props = new Properties();
+ props.setProperty("TransportType", ProtocolTypeConstants.AUTH_KEY.getValue());
+ props.setProperty("host", "ServiceName");
+ props.setProperty("topic", "topic");
+ props.setProperty("username", "username");
+ props.setProperty("contenttype", "contenttype");
+ props.setProperty("password", "password");
+
+ try{
+ ValidatorUtil.validatePublisher(props);
+ } catch(IllegalArgumentException e) {
+ assertEquals(e.getMessage(), "authKey is needed");
+ }
+
+ }
+
+ @Test
+ public void testValidateForNonDME2WithAuthDate() {
+ Properties props = new Properties();
+ props.setProperty("TransportType", ProtocolTypeConstants.AUTH_KEY.getValue());
+ props.setProperty("host", "ServiceName");
+ props.setProperty("topic", "topic");
+ props.setProperty("username", "username");
+ props.setProperty("contenttype", "contenttype");
+ props.setProperty("password", "password");
+ props.setProperty("authKey", "authKey");
+
+ try{
+ ValidatorUtil.validatePublisher(props);
+ } catch(IllegalArgumentException e) {
+ assertEquals(e.getMessage(), "authDate is needed");
+ }
+
+ }
+