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

Testing headers in multiple messages

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      The need is something similar to expectedBodiesReceivedInAnyOrder applied to headers :

      I know that a given endpoint will receive 3 messages in any order, and I need to test ONE header in each of these messages.

      I wrote :
      getMockEndpoint("mock:zipSHP").expectedHeaderReceived("zippedFile", "001.zip");
      getMockEndpoint("mock:zipSHP").expectedHeaderReceived("zippedFile", "002.zip");
      getMockEndpoint("mock:zipSHP").expectedHeaderReceived("zippedFile", "003.zip");

      for the route :
      for("file://filesToBeZipped/").to("bean:my.bean.ZipperBean").log("Zipped : ...");

      The endpoint effectively received the three messages (the results of three ZIP operations) but the test failed saying that the first message header was "003.zip" and not the expected "001.zip".

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            developpef Paul-Emmanuel Faidherbe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: