diff options
Diffstat (limited to 'message-router/publisher/provider/src/test')
-rw-r--r-- | message-router/publisher/provider/src/test/java/org/onap/ccsdk/sli/adaptors/messagerouter/publisher/provider/impl/PublisherApiImplTest.java | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/message-router/publisher/provider/src/test/java/org/onap/ccsdk/sli/adaptors/messagerouter/publisher/provider/impl/PublisherApiImplTest.java b/message-router/publisher/provider/src/test/java/org/onap/ccsdk/sli/adaptors/messagerouter/publisher/provider/impl/PublisherApiImplTest.java deleted file mode 100644 index 53744f73e..000000000 --- a/message-router/publisher/provider/src/test/java/org/onap/ccsdk/sli/adaptors/messagerouter/publisher/provider/impl/PublisherApiImplTest.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.onap.ccsdk.sli.adaptors.messagerouter.publisher.provider.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.net.HttpURLConnection;
-import java.net.URL;
-
-import org.junit.Test;
-
-public class PublisherApiImplTest {
- @Test
- public void verifyDefaultTimeouts() {
- PublisherApiImpl pub = new PublisherApiImpl();
- assertEquals(pub.DEFAULT_CONNECT_TIMEOUT, pub.connectTimeout);
- assertEquals(pub.DEFAULT_READ_TIMEOUT, pub.readTimeout);
- }
-
- @Test
- public void buildHttpURLConnection() throws Exception {
- PublisherApiImpl pub = new PublisherApiImpl();
- pub.init();
-
- String myUserName = "Batman";
- pub.setUsername(myUserName);
- assertEquals(myUserName, pub.username);
- String password = "P@$$";
- pub.setPassword(password);
-
- HttpURLConnection httpUrlConnection = pub.buildHttpURLConnection(new URL("http://localhost:7001"));
- assertNotNull(httpUrlConnection.getReadTimeout());
- assertNotNull(httpUrlConnection.getConnectTimeout());
- assertEquals("application/json", httpUrlConnection.getRequestProperty("Content-Type"));
- assertEquals("application/json", httpUrlConnection.getRequestProperty("Accept"));
- }
-
- @Test
- public void testMultipleHosts() {
- PublisherApiImpl pub = new PublisherApiImpl();
- String myTopic = "worldNews";
- String hostOne = "http://localhost:7001";
- String hostTwo = "http://localhost:7002";
- String hostThree = "http://localhost:7003";
-
- pub.setHost(hostOne + "," + hostTwo + "," + hostThree);
-
- assertEquals("http://localhost:7001/events/worldNews", pub.buildUrlString(0, myTopic));
- assertEquals("http://localhost:7002/events/worldNews", pub.buildUrlString(1, myTopic));
- assertEquals("http://localhost:7003/events/worldNews", pub.buildUrlString(2, myTopic));
- }
-}
\ No newline at end of file |