Refactored class and method generation (#1116)

following two event storming sessions with @pilloPl and @OlgaMaciaszek and the Spring Cloud Contract community we've decided to refactor the core modules of Spring Cloud Contract Verifier.

The main idea is that the current `JavaTestGenerator`'s implementation no longer uses complex logic to generate classes and methods.

We've introduced abstractions such as:

-    class body builder (to build classes)
-    groovy and java class metadata
-    imports (for various frameworks)
-    default setup for json, xml, restassured, jaxrs
-    class annotations for spock, junit and junit5
-    field insertion e.g. for messaging
This commit is contained in:
Marcin Grzejszczak
2019-06-27 23:01:37 +02:00
committed by GitHub
parent 954ddfb3d5
commit 972a50265f
238 changed files with 14295 additions and 6992 deletions

View File

@@ -1800,7 +1800,7 @@ following code listing shows the `SingleTestGenerator` interface:
[source,groovy]
----
include::{verifier_core_path}/src/main/groovy/org/springframework/cloud/contract/verifier/builder/SingleTestGenerator.groovy[indent=0,lines=17..-1]
include::{verifier_core_path}/src/main/groovy/org/springframework/cloud/contract/verifier/builder/SingleTestGenerator.java[indent=0,lines=17..-1]
----
Again, you must provide a `spring.factories` file, such as the one shown in the following