diff options
author | asgar <sammoham@in.ibm.com> | 2018-10-04 16:06:43 +0530 |
---|---|---|
committer | Mohamed Asgar Samiulla <sammoham@in.ibm.com> | 2018-10-08 08:31:01 +0000 |
commit | 79f657619d0af685d68fb6515ec9f59c308bf255 (patch) | |
tree | 4051fa83a80aa9d94e05e4dc57088ab9733fdf70 /src | |
parent | 52a67e4f8b5d131d5eac1f351caebbaf2d088929 (diff) |
few more cases added to validatorutil.java
Change-Id: I544bec8b1da6f3fcc601eed109af923d0d97a3de
Issue-ID: DMAAP-809
Signed-off-by: Mohamed Asgar Samiulla <sammoham@in.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/test/java/com/att/nsa/mr/tools/ValidatorUtilTest.java | 92 |
1 files changed, 66 insertions, 26 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 544506f..ec382f4 100644 --- a/src/test/java/com/att/nsa/mr/tools/ValidatorUtilTest.java +++ b/src/test/java/com/att/nsa/mr/tools/ValidatorUtilTest.java @@ -1,28 +1,25 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP Policy Engine - * ================================================================================ - * Copyright (C) 2018 Nokia - * ================================================================================ - * Modifications Copyright © 2018 IBM. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/******************************************************************************* + * ============LICENSE_START======================================================= + * org.onap.dmaap + * ================================================================================ + * Copyright © 2018 IBM Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + * + *******************************************************************************/ -/** - * @author marcin.migdal@nokia.com - */ package com.att.nsa.mr.tools; import static org.junit.Assert.assertEquals; @@ -265,9 +262,52 @@ public class ValidatorUtilTest { assertEquals(e.getMessage(), "MessageSentThreadOccurance is needed"); } - - - } + } + + + @Test + public void testValidateSubscriberWithoutGroup() { + 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"); + props.setProperty("authDate", "authDate"); + props.setProperty("maxBatchSize", "maxBatchSize"); + props.setProperty("maxAgeMs", "maxAgeMs"); + + try{ + ValidatorUtil.validateSubscriber(props); + } catch(IllegalArgumentException e) { + assertEquals(e.getMessage(), "group is needed"); + } + } + + @Test + public void testValidateSubscriberWithoutCustomer() { + 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"); + props.setProperty("authDate", "authDate"); + props.setProperty("maxBatchSize", "maxBatchSize"); + props.setProperty("maxAgeMs", "maxAgeMs"); + props.setProperty("group", "group"); + + try{ + ValidatorUtil.validateSubscriber(props); + } catch(IllegalArgumentException e) { + assertEquals(e.getMessage(), "Consumer (Id) is needed"); + } + } + |