Updated the new docs url; fixes gh-155

This commit is contained in:
Marcin Grzejszczak
2019-08-19 10:39:58 +02:00
parent 940e7ec2ee
commit e625e0186f
2 changed files with 12 additions and 11 deletions

View File

@@ -190,7 +190,7 @@ public class SaganUpdater {
update.version = version.version;
update.releaseStatus = version(version);
update.apiDocUrl = referenceUrl(branch, version);
update.refDocUrl = referenceUrl(branch, version);
update.refDocUrl = update.apiDocUrl;
update.current = true;
return update;
}
@@ -222,15 +222,15 @@ public class SaganUpdater {
if (!version.isSnapshot()) {
// static/sleuth/{version}/
return "https://cloud.spring.io/spring-cloud-static/" + version.projectName
+ "/{version}/";
+ "/{version}/reference/html/";
}
if (branch.toLowerCase().contains("master")) {
// sleuth/
return "https://cloud.spring.io/" + version.projectName + "/"
+ version.projectName + ".html";
return "https://cloud.spring.io/" + version.projectName + "/reference/html/";
}
// sleuth/1.1.x/
return "https://cloud.spring.io/" + version.projectName + "/" + branch + "/";
return "https://cloud.spring.io/" + version.projectName + "/" + branch
+ "/reference/html/";
}
}

View File

@@ -81,7 +81,7 @@ public class SaganUpdaterTest {
then(this.saganClient).should().updateRelease(BDDMockito.eq("foo"),
BDDMockito.argThat(withReleaseUpdate("1.0.0.M1",
"https://cloud.spring.io/spring-cloud-static/foo/{version}/",
"https://cloud.spring.io/spring-cloud-static/foo/{version}/reference/html/",
"PRERELEASE")));
}
@@ -92,7 +92,7 @@ public class SaganUpdaterTest {
then(this.saganClient).should().updateRelease(BDDMockito.eq("foo"),
BDDMockito.argThat(withReleaseUpdate("1.0.0.RC1",
"https://cloud.spring.io/spring-cloud-static/foo/{version}/",
"https://cloud.spring.io/spring-cloud-static/foo/{version}/reference/html/",
"PRERELEASE")));
}
@@ -207,7 +207,7 @@ public class SaganUpdaterTest {
then(this.saganClient).should().updateRelease(BDDMockito.eq("foo"),
BDDMockito.argThat(withReleaseUpdate("1.0.0.BUILD-SNAPSHOT",
"https://cloud.spring.io/foo/foo.html", "SNAPSHOT")));
"https://cloud.spring.io/foo/reference/html/", "SNAPSHOT")));
}
@Test
@@ -221,12 +221,12 @@ public class SaganUpdaterTest {
then(this.saganClient).should().deleteRelease("foo", "1.0.0.BUILD-SNAPSHOT");
then(this.saganClient).should().updateRelease(BDDMockito.eq("foo"),
BDDMockito.argThat(withReleaseUpdate("1.0.0.RELEASE",
"https://cloud.spring.io/spring-cloud-static/foo/{version}/",
"https://cloud.spring.io/spring-cloud-static/foo/{version}/reference/html/",
"GENERAL_AVAILABILITY")));
then(this.saganClient).should().deleteRelease("foo", "1.0.0.BUILD-SNAPSHOT");
then(this.saganClient).should().updateRelease(BDDMockito.eq("foo"),
BDDMockito.argThat(withReleaseUpdate("1.0.1.BUILD-SNAPSHOT",
"https://cloud.spring.io/foo/foo.html", "SNAPSHOT")));
"https://cloud.spring.io/foo/reference/html/", "SNAPSHOT")));
}
@Test
@@ -239,7 +239,8 @@ public class SaganUpdaterTest {
then(this.saganClient).should(never()).deleteRelease(anyString(), anyString());
then(this.saganClient).should().updateRelease(BDDMockito.eq("foo"),
BDDMockito.argThat(withReleaseUpdate("1.1.0.BUILD-SNAPSHOT",
"https://cloud.spring.io/foo/1.1.x/", "SNAPSHOT")));
"https://cloud.spring.io/foo/1.1.x/reference/html/",
"SNAPSHOT")));
}
private ArgumentMatcher<List<ReleaseUpdate>> withReleaseUpdate(final String version,