ordepdev / ordepdev.github.io

random programming stuff
http://ordepdev.me
3 stars 0 forks source link

Comments to "Boost your confidence with Consumer-Driven Contracts" #3

Closed marcingrzejszczak closed 7 years ago

marcingrzejszczak commented 7 years ago

Unit testing When performing unit tests on services that depend on other external services,

I think that those are integration tests. IMO unit tests have any external dependencies stubbed.

Consumer-Driven Contracts Git Flow

The gif is awesome :D It could be a little bit slower though I guess.

Remember that the purpose of contract testing is not to start writing business features in the contracts. Stay focused and limit yourself to testing contracts between applications and avoid full behaviour simulation.

šŸ‘ šŸ‘ šŸ‘ šŸ‘ šŸ‘

headers { header("Content-Type", "application/json") }

Instead of this ^^ you can write

headers {
contentType(applicationJson())
}

headers { header("Content-Type", value(consumer("application/json"), producer(regex("application/json.*")))) }

Instead of this ^^ you can write

headers {
contentType(applicationJson())
}

As a consumer, the goal is to perform tests against the defined contract. In order to be able to perform those tests, a WireMock stub is also generated.

If this is an introductory blog post then I guess you should describe what WireMock is and point to their docs.

@AutoConfigureStubRunner(workOffline = true, ids = "me.ordepdev.contracts:+:stubs:8080")

Have you explained what this workOffline flag is and why it shouldn't be there once everything gets merged?

Other than these small remarks the blog post is really nice - thanks for writing it :)

And as usual feedback on the tool is more than welcome :D

ordepdev commented 7 years ago

Thanks, @marcingrzejszczak. Really appreciated! It's already improved šŸ‘