X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=provider%2Fbuild.gradle;h=b5e461b4d905d822940e1f60cbbd4122dcf0851b;hb=22ec4700f6d4519c71ab115e2d33fb053d00940f;hp=d9c520fde2346b2ce04f8f722db6184fa9b8f853;hpb=d3a04cd969afdc761963b831f0846e81eaa5d89f;p=demos%2Fexample-siren diff --git a/provider/build.gradle b/provider/build.gradle index d9c520f..b5e461b 100644 --- a/provider/build.gradle +++ b/provider/build.gradle @@ -3,26 +3,55 @@ plugins { id 'io.spring.dependency-management' version '1.0.10.RELEASE' id 'java' id "io.freefair.lombok" version "5.2.1" + id "au.com.dius.pact" version "4.2.2" + id "com.wiredforcode.spawn" version "0.8.2" } group = 'io.pactflow.example' -version = '0.0.1-SNAPSHOT' +version = '0.0.1' sourceCompatibility = '11' repositories { + mavenLocal() mavenCentral() } dependencies { implementation 'org.springframework.boot:spring-boot-starter-hateoas' implementation 'com.jayway.jsonpath:json-path' - implementation 'de.ingogriebsch.hateoas:spring-hateoas-siren:1.0.0-M2' + implementation 'de.ingogriebsch.hateoas:spring-hateoas-siren:1.0.0' testImplementation('org.springframework.boot:spring-boot-starter-test') { exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' } + testImplementation 'au.com.dius.pact.provider:junit5spring:4.2.2' } test { useJUnitPlatform() } + +task startServer(type: SpawnProcessTask, dependsOn: 'assemble') { + command "java -jar ${projectDir}/build/libs/siren-provider-0.0.1.jar" + ready 'Started SirenProviderApplication' +} + +task stopServer(type: KillProcessTask) + +pact { + serviceProviders { + "Siren Order Provider" { + + startProviderTask = startServer + terminateProviderTask = stopServer + + hasPactWith("Siren Consumer") { + pactSource = file("${projectDir}/../consumer/pacts/Siren Order Provider-Siren Order Service.json") + } + + hasPactWith("Spring Consumer") { + pactSource = file("${projectDir}/../spring-consumer/target/pacts/SpringConsumer-SirenOrderProvider.json") + } + } + } +}