aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-03-20 07:36:55 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-20 07:36:55 +0000
commit19dbc47e45ab14961f4257055460c9f73bc5a48b (patch)
tree866dc14d0ccd1824c211e9e7c743ca77770b998d
parent1e5d88a280b09ee2c38e4e0a24207cf6856bf85e (diff)
parent94cc24aa5088c9c1ad40959d783745a39b89dcd8 (diff)
Merge "Add test case for DmaapPublisher"
-rw-r--r--common/src/test/java/org/openecomp/mso/client/dmaap/DmaapPublisherTest.java60
1 files changed, 60 insertions, 0 deletions
diff --git a/common/src/test/java/org/openecomp/mso/client/dmaap/DmaapPublisherTest.java b/common/src/test/java/org/openecomp/mso/client/dmaap/DmaapPublisherTest.java
new file mode 100644
index 0000000000..a9bf81d2ad
--- /dev/null
+++ b/common/src/test/java/org/openecomp/mso/client/dmaap/DmaapPublisherTest.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei 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=========================================================
+ */
+package org.openecomp.mso.client.dmaap;
+
+import org.junit.Test;
+
+import javax.ws.rs.ProcessingException;
+import java.io.IOException;
+import java.util.Optional;
+
+public class DmaapPublisherTest {
+
+ DmaapPublisher dmaapPublisher = new DmaapPublisher(120) {
+ @Override
+ public String getUserName() {
+ return "test";
+ }
+
+ @Override
+ public String getPassword() {
+ return "test";
+ }
+
+ @Override
+ public String getTopic() {
+ return "test";
+ }
+
+ @Override
+ public Optional<String> getHost() {
+ return Optional.of("http://localhost:8080");
+ }
+ };
+
+ public DmaapPublisherTest() throws IOException {
+ }
+
+ @Test(expected = ProcessingException.class)
+ public void sendTest() throws Exception {
+ dmaapPublisher.send("{'key': 'value'}");
+ }
+
+} \ No newline at end of file