Search code examples
spring-cloud-contract

In SCC does it make any difference w.r.t. programming languages that the contracts are written in Groovy?


Pact document lists this as a flaw in SCC. To quote Pact:

Pact generates language-neutral acceptance contracts, in the form of JSON pact files. These pact files can be created, or tested, by anything that implements the Pact specification, whether the code is Ruby, Javascript, the JVM, or any other language. Even though it is possible to use SCC with non-JVM languages, it has no native support for them and requires that contracts are written manually in YAML and the use of Docker to run the tests.

However, on going through lots of docs for SCC, I find that it doesn't matter if you're using Groovy for writing the contract. The reason is that you're not really tied to Java because (based on my understanding)

  1. The SCC plugin will do the job of creating the stubs for you + running the contract against the service
  2. At the consumer side the stub can be used directly so there's no question of parsing the contract file directly

So my question is does it matter what language you use for SCC w.r.t. contracts written in Groovy? In other words, does writing SCC contracts in Groovy tie you down to a particular language anywhere in the entire workflow?


Solution

  • No it doesn't. Most likely that part of the Pact docs was written a couple of years ago. You can define the contract in YAML, Java, Groovy, Kotlin or Pact JSON and the functionality will be the same.