Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.12.1
    • Fix Version/s: 2.11.3, 2.12.3, 2.13.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      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)

        Activity

        Hide
        jhm Jan Matèrne added a comment -

        I have written test and implementation and have created a pull request from github.
        It's my first PR so please have a look.

        Show
        jhm Jan Matèrne added a comment - I have written test and implementation and have created a pull request from github. It's my first PR so please have a look.
        Hide
        hadrian Hadrian Zbarcea added a comment -

        Your patch looks good. It requires a minor change to pass checkstyle. Thanks for the contribution.

        Show
        hadrian Hadrian Zbarcea added a comment - Your patch looks good. It requires a minor change to pass checkstyle. Thanks for the contribution.
        Hide
        jhm Jan Matèrne added a comment -

        Thanks for pointing to checkstyle.
        I have to read http://camel.apache.org/building.html carefully

        mvn -Psourcecheck clean install

        Show
        jhm Jan Matèrne added a comment - Thanks for pointing to checkstyle. I have to read http://camel.apache.org/building.html carefully mvn -Psourcecheck clean install
        Hide
        jhm Jan Matèrne added a comment -

        Next try ....

        Show
        jhm Jan Matèrne added a comment - Next try ....
        Hide
        hadrian Hadrian Zbarcea added a comment -

        Patches applied with thanks to Jan.

        Show
        hadrian Hadrian Zbarcea added a comment - Patches applied with thanks to Jan.
        Hide
        jhm Jan Matèrne added a comment -

        done with git:bfd4204d4dd4de87593a8c7682ea761dd708c83d

        Show
        jhm Jan Matèrne added a comment - done with git:bfd4204d4dd4de87593a8c7682ea761dd708c83d

          People

          • Assignee:
            hadrian Hadrian Zbarcea
            Reporter:
            jhm Jan Matèrne
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development