diff options
author | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2018-03-20 06:09:34 +0000 |
---|---|---|
committer | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2018-03-20 06:09:34 +0000 |
commit | 94cc24aa5088c9c1ad40959d783745a39b89dcd8 (patch) | |
tree | f723beb74fc90f417b30b7859adf058ba107720c /common/src/test/java | |
parent | 9e767c422befcea2d590b0921881c71dcebbffe8 (diff) |
Add test case for DmaapPublisher
Add test case for DmaapPublisher.
Change-Id: Ia69b174eb429a1b9e69a250eb1110334a97785aa
Issue-ID: SO-369
Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'common/src/test/java')
-rw-r--r-- | common/src/test/java/org/openecomp/mso/client/dmaap/DmaapPublisherTest.java | 60 |
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 |