File tree 4 files changed +15
-7
lines changed
src/test/java/au/com/dius/pactworkshop/provider
4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -1084,7 +1084,7 @@ pact {
1084
1084
pactBrokerUrl = 'http://localhost:8000/'
1085
1085
pactBrokerUsername = getOrDefault('PACT_BROKER_USERNAME', 'pact_workshop')
1086
1086
pactBrokerPassword = getOrDefault('PACT_BROKER_PASSWORD', 'pact_workshop')
1087
- tags = [ getGitBranch(), 'test', 'prod']
1087
+ consumerBranch = getGitBranch()
1088
1088
consumerVersion = getGitHash()
1089
1089
}
1090
1090
}
@@ -1150,9 +1150,9 @@ def getGitBranch = { ->
1150
1150
test {
1151
1151
useJUnitPlatform()
1152
1152
1153
+ systemProperty 'pact.provider.branch', getGitBranch()
1153
1154
if (System.getProperty('pactPublishResults') == 'true') {
1154
1155
systemProperty 'pact.provider.version', getGitHash()
1155
- systemProperty 'pact.provider.tag', getGitBranch()
1156
1156
systemProperty 'pact.verifier.publishResults', 'true'
1157
1157
}
1158
1158
}
Original file line number Diff line number Diff line change 72
72
pactBrokerUrl = ' http://localhost:8000/'
73
73
pactBrokerUsername = ' pact_workshop'
74
74
pactBrokerPassword = ' pact_workshop'
75
- tags = [ getGitBranch(), ' test ' , ' prod ' ]
75
+ consumerBranch = getGitBranch()
76
76
consumerVersion = getGitHash()
77
77
}
78
78
}
Original file line number Diff line number Diff line change 1
1
plugins {
2
2
id ' org.springframework.boot' version ' 3.2.2'
3
3
id ' io.spring.dependency-management' version ' 1.1.4'
4
- // id 'io.spring.dependency-management' version '1.1.4'
5
4
}
6
5
7
6
group = ' au.com.dius.pactworkshop'
@@ -40,9 +39,9 @@ def getGitBranch = { ->
40
39
test {
41
40
useJUnitPlatform()
42
41
42
+ systemProperty ' pact.provider.branch' , getGitBranch()
43
43
if (System . getProperty(' pactPublishResults' ) == ' true' ) {
44
44
systemProperty ' pact.provider.version' , getGitHash()
45
- systemProperty ' pact.provider.tag' , getGitBranch()
46
45
systemProperty ' pact.verifier.publishResults' , ' true'
47
46
}
48
47
}
Original file line number Diff line number Diff line change 7
7
import au .com .dius .pact .provider .junitsupport .State ;
8
8
import au .com .dius .pact .provider .junitsupport .loader .PactBroker ;
9
9
import au .com .dius .pact .provider .junitsupport .loader .PactBrokerAuth ;
10
- import au .com .dius .pact .provider .junitsupport .loader .PactFolder ;
10
+ import au .com .dius .pact .provider .junitsupport .loader .SelectorBuilder ;
11
+ // import au.com.dius.pact.provider.junitsupport.loader.PactFolder;
11
12
import org .apache .hc .core5 .http .HttpRequest ;
12
13
import org .junit .jupiter .api .BeforeEach ;
13
14
import org .junit .jupiter .api .TestTemplate ;
33
34
port = "8000" ,
34
35
authentication = @ PactBrokerAuth (username = "pact_workshop" , password = "pact_workshop" )
35
36
)
37
+
36
38
@ ExtendWith (SpringExtension .class )
37
39
@ SpringBootTest (webEnvironment = SpringBootTest .WebEnvironment .RANDOM_PORT )
38
40
public class ProductPactProviderTest {
39
-
41
+ @ au .com .dius .pact .provider .junitsupport .loader .PactBrokerConsumerVersionSelectors
42
+ public static SelectorBuilder consumerVersionSelectors () {
43
+ // Select Pacts for consumers deployed to production with branch from CI build
44
+ return new SelectorBuilder ()
45
+ .deployedOrReleased ()
46
+ .mainBranch ()
47
+ .branch ("dep_update" );
48
+ }
40
49
@ LocalServerPort
41
50
int port ;
42
51
You can’t perform that action at this time.
0 commit comments