pact-jvm icon indicating copy to clipboard operation
pact-jvm copied to clipboard

Provide Pact Broker tags 'lazily'

Open Thorn1089 opened this issue 6 years ago • 1 comments

The @PactBroker annotation allows me to either hard-code tags, or provide them using a system property. The system property lets me specify different tags at runtime, which is great for doing things like testing both develop and master branches on my CI server.

However, it'd be even better if I could specify tags dynamically at runtime. As a specific example, I'd like to write a JUnit test that would determine the current Git branch at runtime and add that branch name to the tags to be tested against (in addition to latest stable develop and master tags). I can manually specify these things in places like Eclipse run configurations or on the command line but that gets tedious.

I'm not sure how this would work in practice - perhaps something similar to the HttpTarget proposal allowing a callback to be provided to determine a dynamic port at runtime, where there could be a PactBroker rule instead of an annotation that accepts either static values, property keys, or callbacks?

Thorn1089 avatar Mar 09 '18 18:03 Thorn1089