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
The following commit(s) were added to refs/heads/master by this push: new 4d60e17 Fixed test 4d60e17 is described below commit 4d60e17b251c826d6bcd2424771abd62493a5a2b Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Sat Feb 27 15:01:36 2021 +0100 Fixed test --- .../file/watch/FileWatchComponentDeleteTest.java | 47 ++++++++++++++++++++++ .../file/watch/FileWatchComponentTest.java | 15 ------- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentDeleteTest.java b/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentDeleteTest.java new file mode 100644 index 0000000..a642a7b --- /dev/null +++ b/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentDeleteTest.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.file.watch; + +import java.nio.file.Files; + +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.junit.jupiter.api.Test; + +public class FileWatchComponentDeleteTest extends FileWatchComponentTestBase { + + @Test + public void testRemoveFile() throws Exception { + MockEndpoint mock = getMockEndpoint("mock:watchDelete"); + mock.expectedMessageCount(2); + + Files.delete(testFiles.get(0)); + Files.delete(testFiles.get(1)); + + mock.assertIsSatisfied(); + } + + @Override + protected RouteBuilder createRouteBuilder() throws Exception { + return new RouteBuilder() { + public void configure() { + from("file-watch://" + testPath() + "?events=DELETE") + .to("mock:watchDelete"); + } + }; + } +} diff --git a/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentTest.java b/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentTest.java index ba4955a..6b25275 100644 --- a/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentTest.java +++ b/components/camel-file-watch/src/test/java/org/apache/camel/component/file/watch/FileWatchComponentTest.java @@ -73,18 +73,6 @@ public class FileWatchComponentTest extends FileWatchComponentTestBase { } @Test - public void testRemoveFile() throws Exception { - MockEndpoint mock = getMockEndpoint("mock:watchDelete"); - mock.expectedMessageCount(2); - mock.setResultWaitTime(1000); - - Files.delete(testFiles.get(0)); - Files.delete(testFiles.get(1)); - - mock.assertIsSatisfied(); - } - - @Test public void testAntMatcher() throws Exception { MockEndpoint all = getMockEndpoint("mock:watchAll"); MockEndpoint onlyTxtAnywhere = getMockEndpoint("mock:onlyTxtAnywhere"); @@ -169,9 +157,6 @@ public class FileWatchComponentTest extends FileWatchComponentTestBase { from("file-watch://" + testPath() + "?events=MODIFY") .to("mock:watchModify"); - from("file-watch://" + testPath() + "?events=DELETE") - .to("mock:watchDelete"); - from("file-watch://" + testPath() + "?events=DELETE,CREATE") .to("mock:watchDeleteOrCreate");