Stub and method toString() #45

Closed
jansyk13 opened this Issue Mar 23, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@jansyk13

When calling method gotStubsCommitmentsDone() in EnsureHttp, in case of AssertionError the error message is not comprehensive. This makes testing and debugging hell.

Example:

"Expected stub com.xebialabs.restito.semantics.Stub@6a5f05f5 to be called 1 times, called 0 times instead"

@mkotsur

This comment has been minimized.

Show comment
Hide comment
@mkotsur

mkotsur Mar 23, 2016

Owner

@jansyk13 good point. Would you make a PR for that?

Owner

mkotsur commented Mar 23, 2016

@jansyk13 good point. Would you make a PR for that?

@mkotsur mkotsur closed this in 09fb0d3 Aug 29, 2017

@mkotsur

This comment has been minimized.

Show comment
Hide comment
@mkotsur

mkotsur Aug 29, 2017

Owner

I don't know if you guys are still interested, but now there is a solution! You can assign labels to stubs like this now:

whenHttp(server).match("Fancy stub", get("/neverHappens")).then(ok()).mustHappen();

ensureHttp(server).gotStubsCommitmentsDone();

Then the error message will be:
Expected stub Stub@6a5f05f5 [Fancy stub] to be called 1 times, called 0 times instead

Any feedback is appreciated! /cc @jansyk13 @shamoh

Owner

mkotsur commented Aug 29, 2017

I don't know if you guys are still interested, but now there is a solution! You can assign labels to stubs like this now:

whenHttp(server).match("Fancy stub", get("/neverHappens")).then(ok()).mustHappen();

ensureHttp(server).gotStubsCommitmentsDone();

Then the error message will be:
Expected stub Stub@6a5f05f5 [Fancy stub] to be called 1 times, called 0 times instead

Any feedback is appreciated! /cc @jansyk13 @shamoh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment