diff options
author | subhash kumar singh <subhash.kumar.singh@huawei.com> | 2018-05-02 14:36:28 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-05-02 14:36:28 +0000 |
commit | 55d47b0cdacece200cae94484b24cef41772ad02 (patch) | |
tree | 326e3823f40ea8cb4a60000c822e1cf0fde9a7da | |
parent | 2b85da5040b5cbd0cc586619b27f8ec4d2f1075c (diff) | |
parent | 8336a0adb17a98a2c14bfefeb06de12f16a7e405 (diff) |
Merge changes I5d215880,Ic2f8f861,I2b558d6d,Ie18578b1,I7e3abdf3, ...
* changes:
Comply the constructor declaration to std.
HttpConnection does not thru exception
Remove unused class from the imports
Fix the HEAD name in http profile
Reuse constant names across
Remove unused imports from Auth Client
Del invalid excep throws in OnapCommand getSchema
Add hashCode() for SchemaInfo
5 files changed, 14 insertions, 9 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java b/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java index aa04d556..d3264508 100644 --- a/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java +++ b/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java @@ -67,7 +67,7 @@ public abstract class OnapCommand { this.addDefaultSchemas(OnapCommandConstants.DEFAULT_PARAMETER_FILE_NAME); } - public List<String> getSchemas() throws OnapCommandException { + public List<String> getSchemas() { List<String> schemas = new ArrayList<>(); schemas.addAll(this.defaultSchemas); schemas.add(this.getSchemaName()); diff --git a/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaInfo.java b/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaInfo.java index d4776e16..a4703256 100644 --- a/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaInfo.java +++ b/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaInfo.java @@ -18,6 +18,7 @@ package org.onap.cli.fw.schema; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import org.onap.cli.fw.cmd.OnapCommandType; import org.onap.cli.fw.conf.OnapCommandConstants; @@ -154,4 +155,9 @@ public class OnapCommandSchemaInfo implements Comparable<OnapCommandSchemaInfo> return this.compareTo((OnapCommandSchemaInfo) obj) == 0; } + + @Override + public int hashCode() { + return Objects.hashCode(this.cmdName); + } } diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java b/profiles/http/src/main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java index fa4b9c2f..9b7b4039 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java @@ -22,7 +22,6 @@ import java.util.Map; import org.onap.cli.fw.cmd.OnapCommand; import org.onap.cli.fw.conf.OnapCommandConfig; import org.onap.cli.fw.error.OnapCommandException; -import org.onap.cli.fw.error.OnapCommandInvalidParameterValue; import org.onap.cli.fw.http.cmd.OnapHttpCommand; import org.onap.cli.fw.http.conf.OnapCommandHttpConstants; import org.onap.cli.fw.http.connect.HttpInput; diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java b/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java index a4346a60..e6d5e031 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java @@ -53,12 +53,12 @@ public class OnapCommandHttpConstants { public static final String REQUEST = "request"; public static final String URI = "uri"; public static final String BODY = "body"; - public static final String METHOD_TYPE = "method"; + public static final String METHOD_TYPE = METHOD; public static final String POST = "post"; public static final String GET = "get"; public static final String DELETE = "delete"; public static final String PUT = "put"; - public static final String HEAD = "delete"; + public static final String HEAD = "head"; public static final String HEADERS = "headers"; public static final String QUERIES = "queries"; public static final String COOKIES = "cookies"; diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java index 31786245..aee37236 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java @@ -64,7 +64,6 @@ import org.apache.http.impl.cookie.BasicClientCookie; import org.apache.http.protocol.BasicHttpContext; import org.apache.http.protocol.HttpContext; import org.apache.http.util.EntityUtils; -import org.onap.cli.fw.conf.OnapCommandConstants; import org.onap.cli.fw.http.conf.OnapCommandHttpConstants; import org.onap.cli.fw.http.error.OnapCommandHttpFailure; import org.slf4j.Logger; @@ -111,7 +110,7 @@ public class OnapHttpConnection { * @throws OnapCommandHttpFailure * exception */ - public OnapHttpConnection(boolean debug) throws OnapCommandHttpFailure { + public OnapHttpConnection(boolean debug) { this.debug = debug; } @@ -371,12 +370,13 @@ public class OnapHttpConnection { @NotThreadSafe static class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase { + public HttpDeleteWithBody() { + super(); + } + public String getMethod() { return OnapCommandHttpConstants.DELETE; } - public HttpDeleteWithBody() { - super(); - } } } |