Skip to content

Commit 078104f

Browse files
committed
Merge branch '2.5.x' into 2.6.x
Closes gh-30779
2 parents fb1a25f + 09c7732 commit 078104f

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

ci/images/releasescripts/src/main/java/io/spring/concourse/releasescripts/sdkman/SdkmanService.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* Central class for interacting with SDKMAN's API.
3232
*
3333
* @author Madhura Bhave
34+
* @author Moritz Halbritter
3435
*/
3536
@Component
3637
public class SdkmanService {
@@ -42,6 +43,8 @@ public class SdkmanService {
4243
private static final String DOWNLOAD_URL = "https://repo.spring.io/simple/libs-release-local/org/springframework/boot/spring-boot-cli/"
4344
+ "%s/spring-boot-cli-%s-bin.zip";
4445

46+
private static final String CHANGELOG_URL = "https://github.com/spring-projects/spring-boot/releases/tag/v%s";
47+
4548
private static final String SPRING_BOOT = "springboot";
4649

4750
private final RestTemplate restTemplate;
@@ -66,7 +69,7 @@ public void publish(String version, boolean makeDefault) {
6669
}
6770

6871
private void broadcast(String version) {
69-
BroadcastRequest broadcastRequest = new BroadcastRequest(version);
72+
BroadcastRequest broadcastRequest = new BroadcastRequest(version, String.format(CHANGELOG_URL, version));
7073
RequestEntity<BroadcastRequest> broadcastEntity = RequestEntity.post(URI.create(SDKMAN_URL + "announce/struct"))
7174
.header(CONSUMER_KEY_HEADER, this.properties.getConsumerKey())
7275
.header(CONSUMER_TOKEN_HEADER, this.properties.getConsumerToken())
@@ -135,14 +138,21 @@ static class BroadcastRequest extends Request {
135138

136139
private final String hashtag = SPRING_BOOT;
137140

138-
BroadcastRequest(String version) {
141+
private final String url;
142+
143+
BroadcastRequest(String version, String url) {
139144
super(version);
145+
this.url = url;
140146
}
141147

142148
public String getHashtag() {
143149
return this.hashtag;
144150
}
145151

152+
public String getUrl() {
153+
return url;
154+
}
155+
146156
}
147157

148158
}

ci/images/releasescripts/src/test/java/io/spring/concourse/releasescripts/sdkman/SdkmanServiceTests.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ class SdkmanServiceTests {
4444
@Autowired
4545
private SdkmanService service;
4646

47-
@Autowired
48-
private SdkmanProperties properties;
49-
5047
@Autowired
5148
private MockRestServiceServer server;
5249

@@ -56,23 +53,23 @@ void tearDown() {
5653
}
5754

5855
@Test
59-
void publishWhenMakeDefaultTrue() throws Exception {
56+
void publishWhenMakeDefaultTrue() {
6057
setupExpectation("https://vendors.sdkman.io/release",
6158
"{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"url\": \"https://repo.spring.io/simple/libs-release-local/org/springframework/boot/spring-boot-cli/1.2.3/spring-boot-cli-1.2.3-bin.zip\"}");
6259
setupExpectation("https://vendors.sdkman.io/default", "{\"candidate\": \"springboot\", \"version\": \"1.2.3\"}",
6360
HttpMethod.PUT);
6461
setupExpectation("https://vendors.sdkman.io/announce/struct",
65-
"{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"hashtag\": \"springboot\"}");
62+
"{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"hashtag\": \"springboot\", \"url\": \"https://github.com/spring-projects/spring-boot/releases/tag/v1.2.3\"}");
6663
this.service.publish("1.2.3", true);
6764
this.server.verify();
6865
}
6966

7067
@Test
71-
void publishWhenMakeDefaultFalse() throws Exception {
68+
void publishWhenMakeDefaultFalse() {
7269
setupExpectation("https://vendors.sdkman.io/release",
7370
"{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"url\": \"https://repo.spring.io/simple/libs-release-local/org/springframework/boot/spring-boot-cli/1.2.3/spring-boot-cli-1.2.3-bin.zip\"}");
7471
setupExpectation("https://vendors.sdkman.io/announce/struct",
75-
"{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"hashtag\": \"springboot\"}");
72+
"{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"hashtag\": \"springboot\", \"url\": \"https://github.com/spring-projects/spring-boot/releases/tag/v1.2.3\"}");
7673
this.service.publish("1.2.3", false);
7774
this.server.verify();
7875
}

0 commit comments

Comments
 (0)