This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 2b194259 Camel-Wordpress: Fixed test
2b194259 is described below
commit 2b1942591e34ff536d328f6d9e600757298b09ad
Author: Andrea Cosentino <[email protected]>
AuthorDate: Tue Dec 1 14:51:21 2020 +0100
Camel-Wordpress: Fixed test
---
.../component/wordpress/WordpressComponentTest.java | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git
a/components/camel-wordpress/src/test/java/org/apache/camel/component/wordpress/WordpressComponentTest.java
b/components/camel-wordpress/src/test/java/org/apache/camel/component/wordpress/WordpressComponentTest.java
index 8f7bd7b..c44e611 100644
---
a/components/camel-wordpress/src/test/java/org/apache/camel/component/wordpress/WordpressComponentTest.java
+++
b/components/camel-wordpress/src/test/java/org/apache/camel/component/wordpress/WordpressComponentTest.java
@@ -16,7 +16,6 @@
*/
package org.apache.camel.component.wordpress;
-import org.apache.camel.component.wordpress.api.model.PostOrderBy;
import org.apache.camel.component.wordpress.api.model.PostSearchCriteria;
import org.apache.camel.test.junit5.CamelTestSupport;
import org.junit.jupiter.api.Test;
@@ -25,10 +24,7 @@ import org.slf4j.LoggerFactory;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.emptyCollectionOf;
-import static org.hamcrest.Matchers.not;
import static org.junit.jupiter.api.Assertions.assertNotNull;
public class WordpressComponentTest extends CamelTestSupport {
@@ -42,17 +38,14 @@ public class WordpressComponentTest extends
CamelTestSupport {
final WordpressEndpoint endpoint = (WordpressEndpoint) component
.createEndpoint(
-
"wordpress:post?apiVersion=2&url=http://mysite.com/&criteria.search=test&criteria.page=1&criteria.perPage=10&criteria.orderBy=author&criteria.categories=camel,dozer,json");
+
"wordpress:post?apiVersion=2&url=http://mysite.com&criteria.search=test&criteria.page=1&criteria.perPage=10&criteria.orderBy=author&criteria.categories=camel,dozer,json");
assertThat(endpoint.getConfiguration().getSearchCriteria(),
instanceOf(PostSearchCriteria.class));
assertNotNull(endpoint.getConfiguration().getSearchCriteria());
- assertThat(endpoint.getConfiguration().getSearchCriteria().getPage(),
is(1));
-
assertThat(endpoint.getConfiguration().getSearchCriteria().getPerPage(),
is(10));
-
assertThat(endpoint.getConfiguration().getSearchCriteria().getSearch(),
is("test"));
- assertThat(((PostSearchCriteria)
endpoint.getConfiguration().getSearchCriteria()).getOrderBy(),
is(PostOrderBy.author));
- assertThat(((PostSearchCriteria)
endpoint.getConfiguration().getSearchCriteria()).getCategories(),
notNullValue());
- assertThat(((PostSearchCriteria)
endpoint.getConfiguration().getSearchCriteria()).getCategories(),
- not(emptyCollectionOf(String.class)));
+ assertThat(endpoint.getConfiguration().getCriteria().get("page"),
is("1"));
+ assertThat(endpoint.getConfiguration().getCriteria().get("perPage"),
is("10"));
+ assertThat(endpoint.getConfiguration().getCriteria().get("search"),
is("test"));
+ assertThat((endpoint.getConfiguration().getCriteria().get("orderBy")),
is("author"));
LOGGER.info("Categories are {}",
((PostSearchCriteria)
endpoint.getConfiguration().getSearchCriteria()).getCategories());