|
|
@ -44,9 +44,6 @@ class SdkmanServiceTests {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private SdkmanService service;
|
|
|
|
private SdkmanService service;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private SdkmanProperties properties;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private MockRestServiceServer server;
|
|
|
|
private MockRestServiceServer server;
|
|
|
|
|
|
|
|
|
|
|
@ -56,23 +53,23 @@ class SdkmanServiceTests {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
void publishWhenMakeDefaultTrue() throws Exception {
|
|
|
|
void publishWhenMakeDefaultTrue() {
|
|
|
|
setupExpectation("https://vendors.sdkman.io/release",
|
|
|
|
setupExpectation("https://vendors.sdkman.io/release",
|
|
|
|
"{\"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\"}");
|
|
|
|
"{\"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\"}");
|
|
|
|
setupExpectation("https://vendors.sdkman.io/default", "{\"candidate\": \"springboot\", \"version\": \"1.2.3\"}",
|
|
|
|
setupExpectation("https://vendors.sdkman.io/default", "{\"candidate\": \"springboot\", \"version\": \"1.2.3\"}",
|
|
|
|
HttpMethod.PUT);
|
|
|
|
HttpMethod.PUT);
|
|
|
|
setupExpectation("https://vendors.sdkman.io/announce/struct",
|
|
|
|
setupExpectation("https://vendors.sdkman.io/announce/struct",
|
|
|
|
"{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"hashtag\": \"springboot\"}");
|
|
|
|
"{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"hashtag\": \"springboot\", \"url\": \"https://github.com/spring-projects/spring-boot/releases/tag/v1.2.3\"}");
|
|
|
|
this.service.publish("1.2.3", true);
|
|
|
|
this.service.publish("1.2.3", true);
|
|
|
|
this.server.verify();
|
|
|
|
this.server.verify();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
void publishWhenMakeDefaultFalse() throws Exception {
|
|
|
|
void publishWhenMakeDefaultFalse() {
|
|
|
|
setupExpectation("https://vendors.sdkman.io/release",
|
|
|
|
setupExpectation("https://vendors.sdkman.io/release",
|
|
|
|
"{\"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\"}");
|
|
|
|
"{\"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\"}");
|
|
|
|
setupExpectation("https://vendors.sdkman.io/announce/struct",
|
|
|
|
setupExpectation("https://vendors.sdkman.io/announce/struct",
|
|
|
|
"{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"hashtag\": \"springboot\"}");
|
|
|
|
"{\"candidate\": \"springboot\", \"version\": \"1.2.3\", \"hashtag\": \"springboot\", \"url\": \"https://github.com/spring-projects/spring-boot/releases/tag/v1.2.3\"}");
|
|
|
|
this.service.publish("1.2.3", false);
|
|
|
|
this.service.publish("1.2.3", false);
|
|
|
|
this.server.verify();
|
|
|
|
this.server.verify();
|
|
|
|
}
|
|
|
|
}
|
|
|
|