spring-cloud-contract icon indicating copy to clipboard operation
spring-cloud-contract copied to clipboard

Add multiple base test classes support

Open marcingrzejszczak opened this issue 10 years ago • 7 comments

Moved from https://github.com/Codearte/accurest/issues/205

marcingrzejszczak avatar Jul 11 '16 09:07 marcingrzejszczak

Anyone lands here can have a look at https://cloud.spring.io/spring-cloud-contract/multi/multi__spring_cloud_contract_verifier_setup.html#gradle-different-base-classes

dhanaraj0 avatar Dec 13 '18 05:12 dhanaraj0

Hello Team,

Is this resolved.

Is this allowed to define multiple packages for basePackageForTests and is multiple classes allowed for baseClassForTests.?

basePackageForTests = 'com.testcompany.testgroup.abc' baseClassForTests = "com.testcompany.testgroup.abc.ApplicationTest"

Here I want to add multiple packages and classes for base package/class.

Can you please let me know.

Thanks, Naresh

nareshn842 avatar Jul 19 '21 10:07 nareshn842

No, you have to use the regex based base class matching

marcingrzejszczak avatar Jul 19 '21 10:07 marcingrzejszczak

@marcingrzejszczak Hi , Can you please share some reference for regex base class matching.

nareshn842 avatar Jul 19 '21 11:07 nareshn842

It's in the documentation - https://docs.spring.io/spring-cloud-contract/docs/current/reference/html/gradle-project.html#by-mapping and https://docs.spring.io/spring-cloud-contract/docs/current/reference/html/maven-project.html#by-mapping

marcingrzejszczak avatar Jul 19 '21 11:07 marcingrzejszczak

Thank you for the reply. Can you confirm to use this regex syntax, we need to use spring cloud contract 3.0 version and Spring Boot version 2.4 please confirm .?

We are using boot 2.2.2 and contract version 2.1.1 . With this version its not compiling.

Thanks, Naresh

nareshn842 avatar Jul 19 '21 13:07 nareshn842

This got fixed 5 years ago. Please double check what you're doing.

marcingrzejszczak avatar Jul 19 '21 14:07 marcingrzejszczak