Good evening community, Anyone knows about a libra...
# pact-jvm
a
Good evening community, Anyone knows about a library with similar functionality to this one? To try to automate the Dsl body generation using Java objects. https://github.com/remondis-it/pact-consumer-builder We're having compatibility issues with this one due to be outdated
t
Hmmm. I don’t know about this. Wouldn’t this approach mean you’re not sure if the code actually does what you think it does?
I think the explicit nature of Pact is a feature
(also, sorry, I don’t know if there is another library like that)
m
I know a client here in Melbourne when I was still consulting, created an Intellij plugin to do something similar to this. The idea is that you would get an IDE action that would take a JSON file and then a “create test” from it. The customer already had a large suite of fixture files for use in other tests, so being able to go back from them into code was helpful. The tests would need to be manually reviewed, but it just prevented a bunch of painful manual work to get large or complex data structures mapped into the appropriate JVM DSL.
t
Yeah. I have wondered about "trust me mode" for Pact - where you go "look, just match whatever I send" for the request. This would avoid the problem where clients emit headers that break the provider, but don't declare them in the Pact (so they don't end up in the test)
🤔 1
a
I wasn't very excited about the idea of using/creating a library like this, but the client has insisted and... it really does make sense after all. They have some teams with HUGE bodies of work to be defined, and 95% of those bodies consist of pretty standard validations. Of course, you would need to review the BodyDSL generated, and sometimes include specific type mappings, but it could potentially save a lot of time for the teams (and even avoid scaring them, sometimes when they see the amount of code to write they start freaking out 😂)
m
It would be a great addition to the ecosystem Alejandro, if you could OSS it 😉
But yes, it’s a common question and I see value in it. If you could make the test fail by default, so it had to be reviewed, that could be a simple way to prevent it from being auto-generated without review
a
That's a good point, yes. I'll talk with our folks and let's see if we can do something 🙂
👍 1