lundi 30 mars 2020

How to trigger a method with mocked service?

For testing my service, I am mocking some external services (mockserver). The problematic situation comes up when I need to trigger a method with a mocked response.

I have:

mock.when(request("some/path"))
    .respond(response().withStatusCode(200));

And I have:

   doSomething();

What I need: when mock returns 200, trigger doSomething() (java, void). Any input? Thanks!

Aucun commentaire:

Enregistrer un commentaire