Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-6993

Use varargs in PredicateBuilder

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.12.1
    • 2.11.3, 2.12.3, 2.13.0
    • camel-core
    • None
    • Unknown

    Description

      When combining multiple expectations in Tests on MockEndpoints you may use the PredicateBuilder.and() method.

      These methods exists with two signatures:

      • using two Predicates [1]
      • using a List of Predicates [2]

      Combining three Predicates results in constructs like

      • and(one, and(two, three))
      • and(Arrays.asList(one, two, three))

      It would be easier to provide a vararg method like in [3].

      That said the or-method is only available with a signature containing two predicates [4].

      [1] org.apache.camel.builder.PredicateBuilder.and(Predicate, Predicate)
      [2] org.apache.camel.builder.PredicateBuilder.and(List<Predicate>)
      [3] org.apache.camel.builder.PredicateBuilder.in(Predicate...)
      [4] org.apache.camel.builder.PredicateBuilder.or(Predicate, Predicate)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            hadrian Hadrian Zbarcea
            jhm Jan Materne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment