You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/06/05 07:21:32 UTC
[camel] 02/02: CAMEL-17941 - Updating validator to use ObjectHelper
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit dcec655dcf38202947b79bc9e5ceb34784b910c1
Author: Rhuan Rocha <rh...@gmail.com>
AuthorDate: Sat Jun 4 20:52:07 2022 -0300
CAMEL-17941 - Updating validator to use ObjectHelper
Signed-off-by: Rhuan Rocha <rh...@gmail.com>
---
.../dropbox/validator/DropboxConfigurationValidator.java | 10 +++++-----
.../dropbox/integration/producer/DropboxProducerMoveIT.java | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/validator/DropboxConfigurationValidator.java b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/validator/DropboxConfigurationValidator.java
index 0e0d6cc9450..a6c1233b11b 100644
--- a/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/validator/DropboxConfigurationValidator.java
+++ b/components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/validator/DropboxConfigurationValidator.java
@@ -30,22 +30,22 @@ public final class DropboxConfigurationValidator {
}
public static void validateCommonProperties(DropboxConfiguration configuration) throws DropboxException {
- if (configuration.getAccessToken() == null || configuration.getAccessToken().equals("")) {
+ if (ObjectHelper.isEmpty(configuration.getAccessToken())) {
throw new DropboxException("option <accessToken> is not present or not valid!");
}
if (configuration.getExpireIn() == null || configuration.getExpireIn() <= 0) {
throw new DropboxException("option <expireIn> is not present or not valid!");
}
- if (configuration.getRefreshToken() == null || configuration.getRefreshToken().equals("")) {
+ if (ObjectHelper.isEmpty(configuration.getRefreshToken())) {
throw new DropboxException("option <refreshToken> is not present or not valid!");
}
- if (configuration.getApiKey() == null || configuration.getApiKey().equals("")) {
+ if (ObjectHelper.isEmpty(configuration.getApiKey())) {
throw new DropboxException("option <apiKey> is not present or not valid!");
}
- if (configuration.getApiSecret() == null || configuration.getApiSecret().equals("")) {
+ if (ObjectHelper.isEmpty(configuration.getApiSecret())) {
throw new DropboxException("option <apiSecret> is not present or not valid!");
}
- if (configuration.getClientIdentifier() == null || configuration.getClientIdentifier().equals("")) {
+ if (ObjectHelper.isEmpty(configuration.getClientIdentifier())) {
throw new DropboxException("option <clientIdentifier> is not present or not valid!");
}
}
diff --git a/components/camel-dropbox/src/test/java/org/apache/camel/component/dropbox/integration/producer/DropboxProducerMoveIT.java b/components/camel-dropbox/src/test/java/org/apache/camel/component/dropbox/integration/producer/DropboxProducerMoveIT.java
index cd62f20d95a..9dac8c59de4 100644
--- a/components/camel-dropbox/src/test/java/org/apache/camel/component/dropbox/integration/producer/DropboxProducerMoveIT.java
+++ b/components/camel-dropbox/src/test/java/org/apache/camel/component/dropbox/integration/producer/DropboxProducerMoveIT.java
@@ -67,7 +67,7 @@ public class DropboxProducerMoveIT extends DropboxTestSupport {
.to(String.format("dropbox://move?accessToken={{accessToken}}" +
"&expireIn={{expireIn}}" +
"&refreshToken={{refreshToken}}" +
- "&apiKey={{apiKey}}&apiSecret={{apiSecret}}"+
+ "&apiKey={{apiKey}}&apiSecret={{apiSecret}}" +
"&remotePath=%s&newRemotePath=%s",
workdir + "/" + FILE, COPY_WORKDIR + "/" + FILE))
.to("mock:result");