You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ff...@apache.org on 2021/08/24 16:56:53 UTC

[camel] branch camel-3.11.x updated (724f6d8 -> b3f311b)

This is an automated email from the ASF dual-hosted git repository.

ffang pushed a change to branch camel-3.11.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 724f6d8  Deprecate APIs in camel-catalog that should not be used
     new aeb4f20  [CAMEL-16886]NewCommentsConsumerTest#singleIssueCommentsTest fails intermitently
     new b3f311b  [CAMEL-16886]revise comment

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../jira/consumer/NewCommentsConsumerTest.java     | 28 ++++++++++++++--------
 1 file changed, 18 insertions(+), 10 deletions(-)

[camel] 02/02: [CAMEL-16886]revise comment

Posted by ff...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch camel-3.11.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit b3f311b1222609291b46080104bf86e298a5a35d
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Tue Aug 24 12:55:37 2021 -0400

    [CAMEL-16886]revise comment
    
    (cherry picked from commit 4bc37ec3669f90dc09c7e5c1eeb9f44f26b51d3d)
---
 .../apache/camel/component/jira/consumer/NewCommentsConsumerTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewCommentsConsumerTest.java b/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewCommentsConsumerTest.java
index 5c3035b..c0accd0 100644
--- a/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewCommentsConsumerTest.java
+++ b/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewCommentsConsumerTest.java
@@ -148,7 +148,7 @@ public class NewCommentsConsumerTest extends CamelTestSupport {
         }
         // reverse the order, from oldest comment to recent
         Collections.reverse(comments);
-        // expect 6000 comments
+        // expect 3000 comments
         mockResult.expectedBodiesReceived(comments);
         mockResult.assertIsSatisfied();
     }

[camel] 01/02: [CAMEL-16886]NewCommentsConsumerTest#singleIssueCommentsTest fails intermitently

Posted by ff...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ffang pushed a commit to branch camel-3.11.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit aeb4f2091f12d8662ab1cdc8da220d1704e5f2fc
Author: Freeman Fang <fr...@gmail.com>
AuthorDate: Tue Aug 24 12:54:01 2021 -0400

    [CAMEL-16886]NewCommentsConsumerTest#singleIssueCommentsTest fails intermitently
    
    (cherry picked from commit 4fdf85f34fe15fba41965808ce744e1cab55df1b)
---
 .../jira/consumer/NewCommentsConsumerTest.java     | 28 ++++++++++++++--------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewCommentsConsumerTest.java b/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewCommentsConsumerTest.java
index dc7e220..5c3035b 100644
--- a/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewCommentsConsumerTest.java
+++ b/components/camel-jira/src/test/java/org/apache/camel/component/jira/consumer/NewCommentsConsumerTest.java
@@ -129,27 +129,35 @@ public class NewCommentsConsumerTest extends CamelTestSupport {
 
     @Test
     public void singleIssueCommentsTest() throws Exception {
-        // create issue with 3 comments
-        Issue issue = createIssueWithComments(11, 3);
+        Issue issueWithCommends = createIssueWithComments(11L, 3000);
+        Issue issueWithNoComments = createIssue(51L);
+
         reset(issueRestClient);
-        Promise<Issue> promiseIssue = Promises.promise(issue);
-        when(issueRestClient.getIssue(anyString())).thenReturn(promiseIssue);
+        AtomicInteger regulator = new AtomicInteger();
+        when(issueRestClient.getIssue(anyString())).then(inv -> {
+            int idx = regulator.getAndIncrement();
+            Issue issue = issueWithNoComments;
+            if (idx < 1) {
+                issue = issueWithCommends;
+            }
+            return Promises.promise(issue);
+        });
         List<Comment> comments = new ArrayList<>();
-        for (Comment c : issue.getComments()) {
+        for (Comment c : issueWithCommends.getComments()) {
             comments.add(c);
         }
         // reverse the order, from oldest comment to recent
         Collections.reverse(comments);
-        // expect 3 comments
+        // expect 6000 comments
         mockResult.expectedBodiesReceived(comments);
         mockResult.assertIsSatisfied();
     }
 
     @Test
     public void multipleIssuesTest() throws Exception {
-        Issue issue1 = createIssueWithComments(20L, 2);
-        Issue issue2 = createIssueWithComments(21L, 3);
-        Issue issue3 = createIssueWithComments(22L, 1);
+        Issue issue1 = createIssueWithComments(20L, 2000);
+        Issue issue2 = createIssueWithComments(21L, 3000);
+        Issue issue3 = createIssueWithComments(22L, 1000);
         List<Issue> newIssues = new ArrayList<>();
         newIssues.add(issue1);
         newIssues.add(issue2);
@@ -178,7 +186,7 @@ public class NewCommentsConsumerTest extends CamelTestSupport {
         }
         // reverse the order, from oldest comment to recent
         Collections.reverse(comments);
-        // expect 6 comments
+        // expect 6000 comments
         mockResult.expectedBodiesReceived(comments);
         mockResult.assertIsSatisfied();
     }