1
1
/*
2
- * Copyright 2020-2021 the original author or authors.
2
+ * Copyright 2020-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@ void ipAddressesAreObfuscated() throws UnknownHostException {
50
50
new BuildScanConventions (this .processRunner ).execute (this .buildScan );
51
51
assertThat (this .buildScan .obfuscation .ipAddressesObfuscator ).isNotNull ();
52
52
List <String > obfuscatedAddresses = this .buildScan .obfuscation .ipAddressesObfuscator
53
- .apply (Arrays .asList (InetAddress .getByName ("10.0.0.1" ), InetAddress .getByName ("10.0.0.2" )));
53
+ .apply (Arrays .asList (InetAddress .getByName ("10.0.0.1" ), InetAddress .getByName ("10.0.0.2" )));
54
54
assertThat (obfuscatedAddresses ).containsExactly ("0.0.0.0" , "0.0.0.0" );
55
55
}
56
56
@@ -70,22 +70,24 @@ void buildScansAreConfiguredToPublishToGeSpringIo() {
70
70
@ Test
71
71
void whenBambooResultEnvVarIsPresentThenBuildScanIsTaggedWithCiNotLocal () {
72
72
new BuildScanConventions (this .processRunner ,
73
- Collections .singletonMap ("bamboo_resultsUrl" , "https://bamboo.exampl.com" )).execute (this .buildScan );
73
+ Collections .singletonMap ("bamboo_resultsUrl" , "https://bamboo.exampl.com" ))
74
+ .execute (this .buildScan );
74
75
assertThat (this .buildScan .tags ).contains ("CI" ).doesNotContain ("Local" );
75
76
}
76
77
77
78
@ Test
78
79
void whenBambooResultEnvVarIsPresentThenBuildScanHasACiBuildLinkToIt () {
79
80
new BuildScanConventions (this .processRunner ,
80
- Collections .singletonMap ("bamboo_resultsUrl" , "https://bamboo.example.com" )).execute (this .buildScan );
81
+ Collections .singletonMap ("bamboo_resultsUrl" , "https://bamboo.example.com" ))
82
+ .execute (this .buildScan );
81
83
assertThat (this .buildScan .links ).containsEntry ("CI build" , "https://bamboo.example.com" );
82
84
}
83
85
84
86
@ Test
85
87
void whenCircleBuildUrlEnvVarIsPresentThenBuildScanHasACiBuildLinkToIt () {
86
88
new BuildScanConventions (this .processRunner ,
87
89
Collections .singletonMap ("CIRCLE_BUILD_URL" , "https://circleci.example.com/gh/org/project/123" ))
88
- .execute (this .buildScan );
90
+ .execute (this .buildScan );
89
91
assertThat (this .buildScan .links ).containsEntry ("CI build" , "https://circleci.example.com/gh/org/project/123" );
90
92
}
91
93
@@ -107,7 +109,8 @@ void whenCiEnvVarIsPresentThenBuildScanIsTaggedWithCiNotLocal() {
107
109
@ Test
108
110
void whenJenkinsUrlEnvVarIsPresentThenBuildScanIsTaggedWithCiNotLocal () {
109
111
new BuildScanConventions (this .processRunner ,
110
- Collections .singletonMap ("JENKINS_URL" , "https://jenkins.example.com" )).execute (this .buildScan );
112
+ Collections .singletonMap ("JENKINS_URL" , "https://jenkins.example.com" ))
113
+ .execute (this .buildScan );
111
114
assertThat (this .buildScan .tags ).contains ("CI" ).doesNotContain ("Local" );
112
115
}
113
116
@@ -132,7 +135,7 @@ void buildScanIsTaggedWithOperatingSystem() {
132
135
@ Test
133
136
void whenBranchEnvVarIsPresentThenBuildScanIsTaggedAndConfiguredWithCustomValue () {
134
137
new BuildScanConventions (this .processRunner , Collections .singletonMap ("BRANCH" , "1.1.x" ))
135
- .execute (this .buildScan );
138
+ .execute (this .buildScan );
136
139
assertThat (this .buildScan .tags ).contains ("1.1.x" );
137
140
assertThat (this .buildScan .values ).containsEntry ("Git branch" , "1.1.x" );
138
141
}
0 commit comments