Integration testing without a broker

rjames211
rjames211 Member Posts: 2

Hi, I am using solace java jcsmp and want to do some integration tests across gradle modules. The main issue is that we can't use a solace broker in this particular case, so using a local container with the broker isn't an option. Is there an alternative such as mocking the broker somehow?

Tagged:

Comments

  • Aaron
    Aaron Member, Administrator, Moderator, Employee Posts: 638 admin

    Hi @rjames211 ... as of today, not really.

    I'm curious about your use case: do you want to mock responses from the broker (canned JCSMP API responses), or run a broker "in memory" or something that provides the same publish/subscribe capability..?

    And why/what is exactly the issue that you cannot have a Solace broker spun up (or use an already existing one somewhere) for these integration tests?

    Just trying to understand more to help guide our R&D team around potential use cases. Thanks!

  • rjames211
    rjames211 Member Posts: 2

    Thanks for your response, sorry I am only getting back to you.

    The use case I guess was the latter, to simulate a broker in memory, that we could subscribe and publish real messages rather than mock canned responses. The idea was to have tests as close to a production scenario as possible without relying on a real broker.

    We were unable to spin up a broker based on constraints of the project. We decided to rely more heavily on unit testing rather than integration testing to get around it, as you mentioned there doesn't seem to be a way currently to have a mock broker.

    Thank you for your response.