This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
commit 25995998940ae10285ddf63b7cb6ed7db88a239b Author: Carl-Philipp Harmant <[email protected]> AuthorDate: Tue Oct 31 09:55:38 2017 -0500 Change the way default configuration is setup --- .../java/org/apache/camel/component/yql/YqlComponent.java | 3 --- .../component/yql/configuration/YqlConfiguration.java | 6 +++--- .../yql/configuration/YqlConfigurationValidatorTest.java | 14 -------------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/components/camel-yql/src/main/java/org/apache/camel/component/yql/YqlComponent.java b/components/camel-yql/src/main/java/org/apache/camel/component/yql/YqlComponent.java index 8f5d496..6c64a77 100644 --- a/components/camel-yql/src/main/java/org/apache/camel/component/yql/YqlComponent.java +++ b/components/camel-yql/src/main/java/org/apache/camel/component/yql/YqlComponent.java @@ -28,9 +28,6 @@ public class YqlComponent extends DefaultComponent { protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters) throws Exception { final YqlConfiguration configuration = new YqlConfiguration(); configuration.setQuery(remaining); - configuration.setFormat((String) parameters.getOrDefault("format", "json")); - configuration.setDiagnostics(Boolean.getBoolean((String) parameters.getOrDefault("diagnostics", "false"))); - configuration.setCallback((String) parameters.getOrDefault("callback", "")); final Endpoint endpoint = new YqlEndpoint(uri, this, configuration); diff --git a/components/camel-yql/src/main/java/org/apache/camel/component/yql/configuration/YqlConfiguration.java b/components/camel-yql/src/main/java/org/apache/camel/component/yql/configuration/YqlConfiguration.java index 056327d..a3b1854 100644 --- a/components/camel-yql/src/main/java/org/apache/camel/component/yql/configuration/YqlConfiguration.java +++ b/components/camel-yql/src/main/java/org/apache/camel/component/yql/configuration/YqlConfiguration.java @@ -29,13 +29,13 @@ public class YqlConfiguration { private String query; @UriParam - private String format; + private String format = "json"; @UriParam - private boolean diagnostics; + private boolean diagnostics = false; @UriParam - private String callback; + private String callback = ""; public String getQuery() { return query; diff --git a/components/camel-yql/src/test/java/org/apache/camel/component/yql/configuration/YqlConfigurationValidatorTest.java b/components/camel-yql/src/test/java/org/apache/camel/component/yql/configuration/YqlConfigurationValidatorTest.java index b7747a8..e7a6ce0 100644 --- a/components/camel-yql/src/test/java/org/apache/camel/component/yql/configuration/YqlConfigurationValidatorTest.java +++ b/components/camel-yql/src/test/java/org/apache/camel/component/yql/configuration/YqlConfigurationValidatorTest.java @@ -82,20 +82,6 @@ public class YqlConfigurationValidatorTest { } @Test - public void testEmptyFormat() { - // then - thrown.expect(YqlException.class); - thrown.expectMessage("<format> is not valid!"); - - // given - final YqlConfiguration yqlConfiguration = new YqlConfiguration(); - yqlConfiguration.setQuery("query"); - - // when - YqlConfigurationValidator.validateProperties(yqlConfiguration); - } - - @Test public void testWrongFormat() { // then thrown.expect(YqlException.class); -- To stop receiving notification emails like this one, please contact "[email protected]" <[email protected]>.
