在 SCC 中它有什么不同 w.r.t。合同用 Groovy 编写的编程语言?

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

Pact 文档将此列为 SCC 中的缺陷。引用契约:

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.

但是,在查阅大量 SCC 文档后,我发现您是否使用 Groovy 编写合同并不重要。原因是你并没有真正绑定到 Java 因为(根据我的理解)

  1. SCC 插件将为您完成创建存根的工作 + 运行 针对服务的合同
  2. 消费者端可以直接使用存根,不存在直接解析合约文件的问题

所以我的问题是 SCC 使用什么语言有关系 w.r.t。用 Groovy 写的合同?换句话说,在 Groovy 中编写 SCC 合同是否会在整个工作流程的任何地方将您束缚于特定语言?

不,不是。 Pact 文档的那部分很可能是几年前写的。您可以在 YAML、Java、Groovy、Kotlin 或 Pact JSON 中定义合约,功能是相同的。