Remove the username/password check 15/64015/1
authorsunil unnava <su622b@att.com>
Fri, 31 Aug 2018 15:05:31 +0000 (11:05 -0400)
committersunil unnava <su622b@att.com>
Fri, 31 Aug 2018 15:05:52 +0000 (11:05 -0400)
Issue-ID: DMAAP-689
Change-Id: I1b6528bd3aaa2d9d117d0970444123a3c93ac597
Signed-off-by: sunil unnava <su622b@att.com>
pom.xml
src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java
src/main/java/com/att/nsa/mr/client/impl/MRConsumerImpl.java
src/test/java/com/att/nsa/mr/client/impl/MRBaseClientTest.java
version.properties

diff --git a/pom.xml b/pom.xml
index 6ea7f1c..0db71e8 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
        <groupId>org.onap.dmaap.messagerouter.dmaapclient</groupId>
        <artifactId>dmaapClient</artifactId>
        <packaging>jar</packaging>
-       <version>1.1.7-SNAPSHOT</version>
+       <version>1.1.8-SNAPSHOT</version>
        <name>dmaap-messagerouter-dmaapclient</name>
        <description>Client library for MR event routing API</description>
        <url>https://github.com/att/dmaap-framework</url>
index fb49096..76bf5ce 100644 (file)
@@ -261,19 +261,14 @@ public class MRBaseClient extends HttpClient implements MRClient {
                }
        }
 
-       public JSONObject getNoAuth(final String path, final String username, final String password,
-                       final String protocolFlag) throws HttpException, JSONException {
-               if (null != username && null != password) {
-                       WebTarget target=null;
-                       Response response=null;
-                       target = DmaapClientUtil.getTarget(path, username, password);
-                       response = DmaapClientUtil.getResponsewtNoAuth(target);
+       public JSONObject getNoAuth(final String path) throws HttpException, JSONException {
 
-                       return getResponseDataInJson(response);
-               } else {
-                       throw new HttpException(
-                                       "Authentication Failed: Username/password/AuthKey/Authdate parameter(s) cannot be null or empty.");
-               }
+               WebTarget target = null;
+               Response response = null;
+               target = DmaapClientUtil.getTarget(path);
+               response = DmaapClientUtil.getResponsewtNoAuth(target);
+
+               return getResponseDataInJson(response);
        }
 
        public String getAuthResponse(final String path, final String authKey, final String authDate, final String username,
index 72d97c9..bc156ea 100644 (file)
@@ -200,7 +200,7 @@ public class MRConsumerImpl extends MRBaseClient implements MRConsumer {
                         fGroup, fId, props.getProperty("Protocol")), timeoutMs, limit);
 
                 try {
-                    final JSONObject o = getNoAuth(urlPath, username, password, protocolFlag);
+                    final JSONObject o = getNoAuth(urlPath);
                     if (o != null) {
                         final JSONArray a = o.getJSONArray("result");
                         if (a != null) {
index 56cf954..055c94f 100644 (file)
@@ -448,21 +448,11 @@ public class MRBaseClientTest {
                PowerMockito.when(response.getHeaders()).thenReturn(map);
 
                PowerMockito.when(DmaapClientUtil.getResponsewtNoAuth(DmaapClientUtil.getTarget("/path"))).thenReturn(response);
-               mrBaseClient.getNoAuth("/path", "username", "password", "HTTPAUTH");
+               mrBaseClient.getNoAuth("/path");
                assertTrue(true);
 
        }
 
-       @Test(expected = HttpException.class)
-       public void testGetNoAuth_error() throws JSONException, HttpException {
-
-               ResponseBuilder responseBuilder = Response.ok();
-               PowerMockito.when(DmaapClientUtil.getResponsewtNoAuth(DmaapClientUtil.getTarget("/path"))).thenReturn(
-                               responseBuilder.header("transactionid", "transactionid").entity("{\"test\":\"test\"}").build());
-               mrBaseClient.getNoAuth("/path", null, null, "HTTPAUTH");
-               assertTrue(true);
-
-       }
 
        @Test
        public void testGetHTTPErrorResponseMessage() {
index 61001b0..c31717c 100644 (file)
@@ -27,7 +27,7 @@
 
 major=1
 minor=1
-patch=7
+patch=8
 
 base_version=${major}.${minor}.${patch}