Okay so, even if tags is not supported in jvm, can...
# documentation
b
Okay so, even if tags is not supported in jvm, can we just move to new style using the dockerized pact-cli for all related things to pushing pacts?
Copy code
image: pactfoundation/pact-cli:latest
  stage: can-i-deploy
  script:
    - "pact-broker can-i-deploy
      --pacticipant $APPLICATION_NAME
      --version $CI_COMMIT_SHORT_SHA
      # --to production OLD WAY
      --to-environment production
      --broker-base-url $PACT_BROKER_BASE_URL
      --broker-token $PACT_BROKER_API_TOKEN"
1
m
You can do this, absolutely (I recommend using the CLI for all languages)
The consideration here is tat you also need to be able to validate contracts using the
environment
or
branch
otherwise it won’t work
I believe you’re using Java, if so, I think Ron has completed most of the key scenarios for Java as at yesterday, except for Maven support and Junit4 (which is under consideration if it should be deprecated/retired)
b
Right, we wanted to use the cli but for the verify step, however the service cant be launched easily, are we were running the unit tests instead. So we are running junit ya. As per https://pact-foundation.slack.com/archives/C9UN99H24/p1656029211999329?thread_ts=1656026236.477939&cid=C9UN99H24
💯 1
I will recommend to use the cli whenever possible as we go though (in our case mvn and junit5)
m
totally. I’d be going JUnit5 myself also as it’s much nicer (you have access to the service in a unit test context, so can simply/easily mock services, change state etc.)
So I should clarify the above statement. For testing, I’d use the library that integrates most closely with your code (e.g. JUnit for Java, jest-pact for Jest in JS etc.). For non-testing activities like publishing pacts, can I deploy checks etc., use the CLI.
I could probably phrase that better, but hopefully you catch my drift
👍 1