diff options
author | sunil unnava <su622b@att.com> | 2018-08-31 11:05:31 -0400 |
---|---|---|
committer | sunil unnava <su622b@att.com> | 2018-08-31 11:05:52 -0400 |
commit | f25de1912f09ed6d5e3172332913daee1851e704 (patch) | |
tree | b0620ed26e2321ee470d8793e4bdb138e75c4f58 | |
parent | 4cb1f9a13d30bdf0a2b4bd71b74ade305f5ff112 (diff) |
Remove the username/password check
Issue-ID: DMAAP-689
Change-Id: I1b6528bd3aaa2d9d117d0970444123a3c93ac597
Signed-off-by: sunil unnava <su622b@att.com>
-rw-r--r-- | pom.xml | 2 | ||||
-rw-r--r-- | src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java | 19 | ||||
-rw-r--r-- | src/main/java/com/att/nsa/mr/client/impl/MRConsumerImpl.java | 2 | ||||
-rw-r--r-- | src/test/java/com/att/nsa/mr/client/impl/MRBaseClientTest.java | 12 | ||||
-rw-r--r-- | version.properties | 2 |
5 files changed, 11 insertions, 26 deletions
@@ -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> diff --git a/src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java b/src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java index fb49096..76bf5ce 100644 --- a/src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java +++ b/src/main/java/com/att/nsa/mr/client/impl/MRBaseClient.java @@ -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, diff --git a/src/main/java/com/att/nsa/mr/client/impl/MRConsumerImpl.java b/src/main/java/com/att/nsa/mr/client/impl/MRConsumerImpl.java index 72d97c9..bc156ea 100644 --- a/src/main/java/com/att/nsa/mr/client/impl/MRConsumerImpl.java +++ b/src/main/java/com/att/nsa/mr/client/impl/MRConsumerImpl.java @@ -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) { diff --git a/src/test/java/com/att/nsa/mr/client/impl/MRBaseClientTest.java b/src/test/java/com/att/nsa/mr/client/impl/MRBaseClientTest.java index 56cf954..055c94f 100644 --- a/src/test/java/com/att/nsa/mr/client/impl/MRBaseClientTest.java +++ b/src/test/java/com/att/nsa/mr/client/impl/MRBaseClientTest.java @@ -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() { diff --git a/version.properties b/version.properties index 61001b0..c31717c 100644 --- a/version.properties +++ b/version.properties @@ -27,7 +27,7 @@ major=1 minor=1 -patch=7 +patch=8 base_version=${major}.${minor}.${patch} |