Initial commit for spring-cloud-info

This commit is contained in:
Ryan Baxter
2019-05-07 20:18:23 -04:00
parent 0b937a8331
commit 45a284dc45
25 changed files with 3107 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
<module>docs</module>
<module>spring-cloud-release-tools-core</module>
<module>spring-cloud-release-tools-spring</module>
<module>spring-cloud-info</module>
</modules>
<properties>

View File

@@ -0,0 +1,7 @@
---
applications:
- name: spring-cloud-info
memory: 2048M
path: ./target/spring-cloud-info-1.0.0.BUILD-SNAPSHOT.jar
services:
- config-server

155
spring-cloud-info/pom.xml Normal file
View File

@@ -0,0 +1,155 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>spring-cloud-release-tools-parent</artifactId>
<groupId>org.springframework.cloud.internal</groupId>
<version>1.0.0.BUILD-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-info</artifactId>
<properties>
<java.version>1.8</java.version>
<maven-core.version>3.6.1</maven-core.version>
<jcabi-github.version>1.0</jcabi-github.version>
<javax.json-api.version>1.0</javax.json-api.version>
<maven-model.version>3.6.1</maven-model.version>
<scs.version>2.1.2.RELEASE</scs.version>
<spring-cloud.version>Greenwich.RELEASE</spring-cloud.version>
<asciidoctor-maven-plugin.version>1.5.3</asciidoctor-maven-plugin.version>
<spring-rest-docs.version>2.0.3.RELEASE</spring-rest-docs.version>
<maven-resources-plugin.version>2.7</maven-resources-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven-core.version}</version>
</dependency>
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-github</artifactId>
<version>${jcabi-github.version}</version>
</dependency>
<dependency>
<groupId>javax.json</groupId>
<artifactId>javax.json-api</artifactId>
<version>${javax.json-api.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${maven-model.version}</version>
</dependency>
<dependency>
<groupId>io.pivotal.spring.cloud</groupId>
<artifactId>spring-cloud-services-starter-config-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.pivotal.spring.cloud</groupId>
<artifactId>spring-cloud-services-dependencies</artifactId>
<version>${scs.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>${asciidoctor-maven-plugin.version}</version>
<executions>
<execution>
<id>generate-docs</id>
<phase>prepare-package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<backend>html</backend>
<doctype>book</doctype>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-asciidoctor</artifactId>
<version>${spring-rest-docs.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>
${project.basedir}/src/main/resources/static/docs
</outputDirectory>
<resources>
<resource>
<directory>
${project.build.directory}/generated-docs
</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,96 @@
# Rest API
## Spring Cloud Versions
Gets all the available Spring Cloud release trains.
### cURL Request
include::{snippets}/springcloudversions/curl-request.adoc[]
### HTTPie Request
include::{snippets}/springcloudversions/httpie-request.adoc[]
### HTTP Request
include::{snippets}/springcloudversions/http-request.adoc[]
### Response
include::{snippets}/springcloudversions/http-response.adoc[]
### Response Fields
include::{snippets}/springcloudversions/response-fields.adoc[]
## Spring Cloud Version Given Spring Boot Version
Gets the Spring Cloud release train version given a Spring Boot version.
### Path Parameters
include::{snippets}/springcloudversion/path-parameters.adoc[]
### cURL Request
include::{snippets}/springcloudversion/curl-request.adoc[]
### HTTPie Request
include::{snippets}/springcloudversion/httpie-request.adoc[]
### HTTP Request
include::{snippets}/springcloudversion/http-request.adoc[]
### HTTP Response
include::{snippets}/springcloudversion/http-response.adoc[]
### Response Fields
include::{snippets}/springcloudversion/response-fields.adoc[]
## Spring Cloud Project Versions
Get the Spring Cloud project versions for a given Spring Cloud release train.
### cURL Request
include::{snippets}/bomversions/curl-request.adoc[]
### HTTPie Request
include::{snippets}/bomversions/httpie-request.adoc[]
### HTTP Request
include::{snippets}/bomversions/http-request.adoc[]
### HTTP Response
include::{snippets}/bomversions/http-response.adoc[]
## Upcoming Spring Cloud Releases
Gets all the upcoming Spring Cloud releases.
### cURL Request
include::{snippets}/milestones/curl-request.adoc[]
### HTTPie Request
include::{snippets}/milestones/httpie-request.adoc[]
### HTTP Request
include::{snippets}/milestones/http-request.adoc[]
### HTTP Response
include::{snippets}/milestones/http-response.adoc[]
## Get Spring Cloud Release Date
Gets the tentative date given an upcoming Spring Cloud release train name.
### Path Parameters
include::{snippets}/milestoneduedate/path-parameters.adoc[]
### cURL Request
include::{snippets}/milestoneduedate/curl-request.adoc[]
### HTTPie Request
include::{snippets}/milestoneduedate/httpie-request.adoc[]
### HTTP Request
include::{snippets}/milestoneduedate/http-request.adoc[]
### HTTP Response
include::{snippets}/milestoneduedate/http-response.adoc[]
### Response Fields
include::{snippets}/milestoneduedate/response-fields.adoc[]

View File

@@ -0,0 +1,52 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info;
import java.io.IOException;
import java.io.StringReader;
import org.apache.maven.model.Model;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.springframework.web.client.RestTemplate;
/**
* @author Ryan Baxter
*/
public class GithubPomReader {
private MavenXpp3Reader reader;
private RestTemplate rest;
public GithubPomReader(MavenXpp3Reader reader, RestTemplate rest) {
this.reader = reader;
this.rest = rest;
}
public Model readPomFromUrl(String url) throws IOException, XmlPullParserException {
StringReader pomString = new StringReader(rest.getForObject(url, String.class));
try {
return reader.read(pomString);
}
finally {
pomString.close();
}
}
}

View File

@@ -0,0 +1,105 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info;
import java.util.HashMap;
import java.util.Map;
import com.jcabi.github.Github;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cloud.info.exceptions.InitializrParseException;
import org.springframework.cloud.info.exceptions.SpringCloudVersionNotFoundException;
import org.springframework.web.client.RestTemplate;
/**
* @author Ryan Baxter
*/
public class InitializrSpringCloudInfoService extends SpringCloudRelease {
private static final String INITIALIZR_URL = "https://start.spring.io/actuator/info";
private RestTemplate rest;
public InitializrSpringCloudInfoService(RestTemplate rest, Github github,
GithubPomReader reader) {
super(github, reader);
this.rest = rest;
}
@Override
@Cacheable("springCloudViaBoot")
public SpringCloudVersion getSpringCloudVersion(String springBootVersion)
throws SpringCloudVersionNotFoundException {
Map<String, SpringBootAndCloudVersion> cache = new HashMap<>();
Map<String, Object> response = rest.getForObject(INITIALIZR_URL, Map.class);
if (!response.containsKey("bom-ranges")) {
throw new SpringCloudVersionNotFoundException(new InitializrParseException(
"bom-ranges key not found in Initializr info endpoint"));
}
Map<String, Object> bomRanges = (Map<String, Object>) response.get("bom-ranges");
if (!bomRanges.containsKey("spring-cloud")) {
throw new SpringCloudVersionNotFoundException(new InitializrParseException(
"spring-cloud key not found in Initializr info endpoint"));
}
Map<String, String> springCloud = (Map<String, String>) bomRanges
.get("spring-cloud");
for (String key : springCloud.keySet()) {
String rangeString = springCloud.get(key);
cache.put(key, parseRangeString(rangeString, key));
}
for (String key : cache.keySet()) {
if (cache.get(key).matchesSpringBootVersion(springBootVersion)) {
return new SpringCloudVersion(key);
}
}
throw new SpringCloudVersionNotFoundException(springBootVersion);
}
private SpringBootAndCloudVersion parseRangeString(String rangeString,
String springCloudVersion) {
// Example of rangeString Spring Boot >=2.0.0.M3 and <2.0.0.M5
String versions = rangeString.substring(13);
boolean startVersionInclusive = true;
if (versions.charAt(0) == '=') {
versions = versions.substring(1);
}
else {
startVersionInclusive = false;
}
// Example of versions 2.0.0.M3 and <2.0.0.M5 or 2.0.0.M3 and <=2.0.0.M5
String[] cleanedVersions;
boolean endVersionInclusive = true;
if (versions.contains("=")) {
cleanedVersions = versions.split(" and <=");
}
else {
endVersionInclusive = false;
cleanedVersions = versions.split(" and <");
}
if (cleanedVersions.length == 1) {
return new SpringBootAndCloudVersion(cleanedVersions[0],
startVersionInclusive, "99999.99999.99999.RELEASE",
endVersionInclusive, springCloudVersion);
}
return new SpringBootAndCloudVersion(cleanedVersions[0], startVersionInclusive,
cleanedVersions[1], endVersionInclusive, springCloudVersion);
}
}

View File

@@ -0,0 +1,89 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info;
import org.apache.maven.artifact.versioning.ComparableVersion;
/**
* @author Ryan Baxter
*/
public class SpringBootAndCloudVersion {
private String bootStartVersion;
private ComparableVersion comparableBootStartVersion;
private boolean startVersionInclusive;
private String bootEndVersion;
private ComparableVersion comparableBootEndVersion;
private boolean endVersionInclusive;
private String springCloudVersion;
public SpringBootAndCloudVersion(String bootStartVersion,
boolean statVersionInclusive, String bootEndVersion,
boolean endVersionInclusive, String springCloudVersion) {
this.bootEndVersion = bootEndVersion;
this.comparableBootEndVersion = new ComparableVersion(bootEndVersion);
this.endVersionInclusive = endVersionInclusive;
this.bootStartVersion = bootStartVersion;
this.comparableBootStartVersion = new ComparableVersion(bootStartVersion);
this.startVersionInclusive = statVersionInclusive;
this.springCloudVersion = springCloudVersion;
}
String getBootStartVersion() {
return bootStartVersion;
}
void setBootStartVersion(String bootStartVersion) {
this.bootStartVersion = bootStartVersion;
}
String getBootEndVersion() {
return bootEndVersion;
}
void setBootEndVersion(String bootEndVersion) {
this.bootEndVersion = bootEndVersion;
}
String getSpringCloudVersion() {
return springCloudVersion;
}
void setSpringCloudVersion(String springCloudVersion) {
this.springCloudVersion = springCloudVersion;
}
boolean matchesSpringBootVersion(String versionToCheck) {
return matchesSpringBootVersion(new ComparableVersion(versionToCheck));
}
boolean matchesSpringBootVersion(ComparableVersion versionToCheck) {
int startVersionComparison = comparableBootStartVersion.compareTo(versionToCheck);
int endVersionComparison = versionToCheck.compareTo(comparableBootEndVersion);
return ((startVersionInclusive && startVersionComparison == 0)
|| startVersionComparison <= -1)
&& ((endVersionInclusive && endVersionComparison == 0)
|| endVersionComparison <= -1);
}
}

View File

@@ -0,0 +1,63 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info;
import com.jcabi.github.Github;
import com.jcabi.github.RtGithub;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
@EnableCaching
@EnableConfigurationProperties({ SpringCloudInfoConfigurationProperties.class })
public class SpringCloudInfoApplication {
public static void main(String[] args) {
SpringApplication.run(SpringCloudInfoApplication.class, args);
}
@Bean
public SpringCloudInfoService initializrSpringCloudVersionService(
SpringCloudInfoConfigurationProperties properties) {
Github github = new RtGithub(properties.getGit().getOauthToken());
RestTemplate rest = new RestTemplateBuilder().build();
return new InitializrSpringCloudInfoService(rest, github,
new GithubPomReader(new MavenXpp3Reader(), rest));
}
@Configuration
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().permitAll().and().httpBasic().disable()
.csrf().disable();
}
}
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* @author Ryan Baxter
*/
@ConfigurationProperties("spring.cloud.info")
public class SpringCloudInfoConfigurationProperties {
private Git git = new Git();
public Git getGit() {
return git;
}
public void setGit(Git git) {
this.git = git;
}
public static class Git {
private String oauthToken = "";
public String getOauthToken() {
return oauthToken;
}
public void setOauthToken(String oauthToken) {
this.oauthToken = oauthToken;
}
}
}

View File

@@ -0,0 +1,87 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info;
import java.io.IOException;
import java.util.Collection;
import java.util.Map;
import org.springframework.cloud.info.SpringCloudInfoService.SpringCloudVersion;
import org.springframework.cloud.info.exceptions.SpringCloudMilestoneNotFoundException;
import org.springframework.cloud.info.exceptions.SpringCloudVersionNotFoundException;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ResponseStatusException;
/**
* @author Ryan Baxter
*/
@RestController
public class SpringCloudInfoRestController {
private SpringCloudInfoService versionService;
public SpringCloudInfoRestController(SpringCloudInfoService versionService) {
this.versionService = versionService;
}
@GetMapping("/springcloudversion/{bootVersion}")
public SpringCloudVersion version(@PathVariable String bootVersion) {
try {
return versionService.getSpringCloudVersion(bootVersion);
}
catch (SpringCloudVersionNotFoundException e) {
throw new ResponseStatusException(HttpStatus.NOT_FOUND, e.getMessage());
}
}
@GetMapping("/springcloudversions")
public Collection<String> versions() throws IOException {
return versionService.getSpringCloudVersions();
}
@GetMapping("/bomversions/{bomVersion}")
public Map<String, String> bomVersions(@PathVariable String bomVersion)
throws IOException {
try {
return versionService.getReleaseVersions(bomVersion);
}
catch (SpringCloudVersionNotFoundException e) {
throw new ResponseStatusException(HttpStatus.NOT_FOUND, e.getMessage());
}
}
@GetMapping("/milestones")
public Collection<String> milestones() throws IOException {
return versionService.getMilestones();
}
@GetMapping("/milestones/{name}/duedate")
public SpringCloudInfoService.Milestone milestoneDueDate(@PathVariable String name)
throws IOException {
try {
return versionService.getMilestoneDueDate(name);
}
catch (SpringCloudMilestoneNotFoundException e) {
throw new ResponseStatusException(HttpStatus.NOT_FOUND, e.getMessage());
}
}
}

View File

@@ -0,0 +1,121 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info;
import java.io.IOException;
import java.util.Collection;
import java.util.Map;
import java.util.Objects;
import org.springframework.cloud.info.exceptions.SpringCloudMilestoneNotFoundException;
import org.springframework.cloud.info.exceptions.SpringCloudVersionNotFoundException;
/**
* @author Ryan Baxter
*/
public interface SpringCloudInfoService {
SpringCloudVersion getSpringCloudVersion(String bootVersion)
throws SpringCloudVersionNotFoundException;
Collection<String> getSpringCloudVersions() throws IOException;
Map<String, String> getReleaseVersions(String bomVersion)
throws SpringCloudVersionNotFoundException, IOException;
Collection<String> getMilestones() throws IOException;
Milestone getMilestoneDueDate(String name)
throws SpringCloudMilestoneNotFoundException, IOException;
class Milestone {
private String dueDate;
public Milestone() {
}
public Milestone(String dueDate) {
this.dueDate = dueDate;
}
public String getDueDate() {
return dueDate;
}
public void setDueDate(String dueDate) {
this.dueDate = dueDate;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Milestone milestone = (Milestone) o;
return Objects.equals(getDueDate(), milestone.getDueDate());
}
@Override
public int hashCode() {
return Objects.hash(getDueDate());
}
}
class SpringCloudVersion {
private String version;
public SpringCloudVersion() {
}
public SpringCloudVersion(String version) {
this.version = version;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SpringCloudVersion that = (SpringCloudVersion) o;
return Objects.equals(getVersion(), that.getVersion());
}
@Override
public int hashCode() {
return Objects.hash(getVersion());
}
}
}

View File

@@ -0,0 +1,179 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.json.JsonArray;
import javax.json.JsonObject;
import javax.json.JsonReader;
import com.jcabi.github.Coordinates;
import com.jcabi.github.Github;
import com.jcabi.github.Milestone;
import com.jcabi.http.response.JsonResponse;
import org.apache.maven.model.Model;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cloud.info.exceptions.SpringCloudMilestoneNotFoundException;
import org.springframework.cloud.info.exceptions.SpringCloudVersionNotFoundException;
/**
* @author Ryan Baxter
*/
public abstract class SpringCloudRelease implements SpringCloudInfoService {
/**
* Coordinates to Spring Cloud Release in Github.
*/
public static final String SPRING_CLOUD_RELEASE_COORDINATES = "spring-cloud/spring-cloud-release";
/**
* Github tags path.
*/
public static final String SPRING_CLOUD_RELEASE_TAGS_PATH = "repos/"
+ SPRING_CLOUD_RELEASE_COORDINATES + "/tags";
private static final String SPRING_CLOUD_RELEASE_RAW = "https://raw.githubusercontent.com/"
+ SPRING_CLOUD_RELEASE_COORDINATES;
/**
* URL to the raw spring-cloud-dependencies file on Github.
*/
public static final String SPRING_CLOUD_RELEASE_DEPENDENCIES_RAW = SPRING_CLOUD_RELEASE_RAW
+ "/%s/spring-cloud-dependencies/pom.xml";
/**
* URL to the raw spring-cloud-starter-parent file on Github.
*/
public static final String SPRING_CLOUD_STARTER_PARENT_RAW = SPRING_CLOUD_RELEASE_RAW
+ "/%s/spring-cloud-starter-parent/pom.xml";
private Github github;
private GithubPomReader reader;
public SpringCloudRelease(Github github, GithubPomReader reader) {
this.github = github;
this.reader = reader;
}
@Override
@Cacheable("springCloudVersions")
public Collection<String> getSpringCloudVersions() throws IOException {
List<String> releaseVersions = new ArrayList<>();
JsonReader reader = github.entry().uri().path(SPRING_CLOUD_RELEASE_TAGS_PATH)
.back().fetch().as(JsonResponse.class).json();
JsonArray tags = reader.readArray();
reader.close();
List<JsonObject> tagsList = tags.getValuesAs(JsonObject.class);
for (JsonObject obj : tagsList) {
releaseVersions.add(obj.getString("name"));
}
return releaseVersions;
}
@Override
@Cacheable("releaseVersions")
public Map<String, String> getReleaseVersions(String bomVersion)
throws SpringCloudVersionNotFoundException, IOException {
bomVersion = formatBomVersion(bomVersion);
if (!getSpringCloudVersions().contains(bomVersion)) {
throw new SpringCloudVersionNotFoundException();
}
try {
Map<String, String> versions = new HashMap<>();
Model model = reader.readPomFromUrl(
String.format(SPRING_CLOUD_RELEASE_DEPENDENCIES_RAW, bomVersion));
for (String name : model.getProperties().stringPropertyNames()) {
if (name.startsWith("spring-cloud-")) {
versions.put(name.replace(".version", ""),
model.getProperties().getProperty(name));
}
}
versions.put("spring-boot", getSpringCloudBootVersion(bomVersion));
return versions;
}
catch (XmlPullParserException e) {
throw new SpringCloudVersionNotFoundException(e);
}
}
@Override
@Cacheable("milestones")
public Collection<String> getMilestones() throws IOException {
Set<String> milestones = new HashSet<>();
Iterable<com.jcabi.github.Milestone> githubMilestones = getMilestonesFromGithub();
for (com.jcabi.github.Milestone milestone : githubMilestones) {
JsonObject json = milestone.json();
milestones.add(json.getString("title"));
}
return milestones;
}
@Override
@Cacheable("milestoneDueDate")
public Milestone getMilestoneDueDate(String name)
throws SpringCloudMilestoneNotFoundException, IOException {
Iterable<com.jcabi.github.Milestone> milestones = getMilestonesFromGithub();
for (com.jcabi.github.Milestone milestone : milestones) {
JsonObject json = milestone.json();
if (json.getString("title").equalsIgnoreCase(name)) {
if (json.isNull("due_on")) {
return new Milestone("No Due Date");
}
else {
return new Milestone(json.getString("due_on"));
}
}
}
throw new SpringCloudMilestoneNotFoundException(name);
}
private Iterable<com.jcabi.github.Milestone> getMilestonesFromGithub() {
Map<String, String> params = new HashMap<>();
params.put("state", "open");
return github.repos()
.get(new Coordinates.Simple(SPRING_CLOUD_RELEASE_COORDINATES))
.milestones().iterate(params);
}
private String getSpringCloudBootVersion(String bomVersion)
throws IOException, XmlPullParserException {
Model model = reader.readPomFromUrl(
String.format(SPRING_CLOUD_STARTER_PARENT_RAW, bomVersion));
return model.getParent().getVersion();
}
private String formatBomVersion(String bomVersion) {
if (bomVersion.charAt(0) != 'v') {
return "v" + bomVersion;
}
else {
return bomVersion;
}
}
}

View File

@@ -0,0 +1,28 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info.exceptions;
/**
* @author Ryan Baxter
*/
public class InitializrParseException extends Exception {
public InitializrParseException(String msg) {
super(msg);
}
}

View File

@@ -0,0 +1,29 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info.exceptions;
/**
* @author Ryan Baxter
*/
public class SpringCloudMilestoneNotFoundException extends Exception {
public SpringCloudMilestoneNotFoundException(String name) {
super("Spring Cloud milestone " + name
+ " was not found in Spring Cloud Release");
}
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info.exceptions;
/**
* @author Ryan Baxter
*/
public class SpringCloudVersionNotFoundException extends Exception {
public SpringCloudVersionNotFoundException(String springBootVersion) {
super("Spring Cloud version not found for Spring Boot Version "
+ springBootVersion);
}
public SpringCloudVersionNotFoundException(Exception e) {
super("Spring Cloud version not found", e);
}
public SpringCloudVersionNotFoundException() {
super("Spring Cloud version not found");
}
}

View File

@@ -0,0 +1,5 @@
#management:
# endpoints:
# web:
# exposure:
# include: "*"

View File

@@ -0,0 +1,6 @@
spring:
application:
name: spring-cloud-info
cloud:
config:
label: spring-cloud-info-config

View File

@@ -0,0 +1,790 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 1.5.3">
<title>Rest API</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
<style>
/* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */
/* Remove comment around @import statement below when using as a custom stylesheet */
/*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";*/
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}
audio,canvas,video{display:inline-block}
audio:not([controls]){display:none;height:0}
[hidden],template{display:none}
script{display:none!important}
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
body{margin:0}
a{background:transparent}
a:focus{outline:thin dotted}
a:active,a:hover{outline:0}
h1{font-size:2em;margin:.67em 0}
abbr[title]{border-bottom:1px dotted}
b,strong{font-weight:bold}
dfn{font-style:italic}
hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}
mark{background:#ff0;color:#000}
code,kbd,pre,samp{font-family:monospace;font-size:1em}
pre{white-space:pre-wrap}
q{quotes:"\201C" "\201D" "\2018" "\2019"}
small{font-size:80%}
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
sup{top:-.5em}
sub{bottom:-.25em}
img{border:0}
svg:not(:root){overflow:hidden}
figure{margin:0}
fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}
legend{border:0;padding:0}
button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}
button,input{line-height:normal}
button,select{text-transform:none}
button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}
button[disabled],html input[disabled]{cursor:default}
input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}
input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
textarea{overflow:auto;vertical-align:top}
table{border-collapse:collapse;border-spacing:0}
*,*:before,*:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}
html,body{font-size:100%}
body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto}
a:hover{cursor:pointer}
img,object,embed{max-width:100%;height:auto}
object,embed{height:100%}
img{-ms-interpolation-mode:bicubic}
.left{float:left!important}
.right{float:right!important}
.text-left{text-align:left!important}
.text-right{text-align:right!important}
.text-center{text-align:center!important}
.text-justify{text-align:justify!important}
.hide{display:none}
body{-webkit-font-smoothing:antialiased}
img,object,svg{display:inline-block;vertical-align:middle}
textarea{height:auto;min-height:50px}
select{width:100%}
.center{margin-left:auto;margin-right:auto}
.spread{width:100%}
p.lead,.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{font-size:1.21875em;line-height:1.6}
.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0;direction:ltr}
a{color:#2156a5;text-decoration:underline;line-height:inherit}
a:hover,a:focus{color:#1d4b8f}
a img{border:none}
p{font-family:inherit;font-weight:400;font-size:1em;line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility}
p aside{font-size:.875em;line-height:1.35;font-style:italic}
h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em}
h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0}
h1{font-size:2.125em}
h2{font-size:1.6875em}
h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em}
h4,h5{font-size:1.125em}
h6{font-size:1em}
hr{border:solid #ddddd8;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em;height:0}
em,i{font-style:italic;line-height:inherit}
strong,b{font-weight:bold;line-height:inherit}
small{font-size:60%;line-height:inherit}
code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)}
ul,ol,dl{font-size:1em;line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
ul,ol,ul.no-bullet,ol.no-bullet{margin-left:1.5em}
ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0;font-size:1em}
ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit}
ul.square{list-style-type:square}
ul.circle{list-style-type:circle}
ul.disc{list-style-type:disc}
ul.no-bullet{list-style:none}
ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
dl dt{margin-bottom:.3125em;font-weight:bold}
dl dd{margin-bottom:1.25em}
abbr,acronym{text-transform:uppercase;font-size:90%;color:rgba(0,0,0,.8);border-bottom:1px dotted #ddd;cursor:help}
abbr{text-transform:none}
blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}
blockquote cite{display:block;font-size:.9375em;color:rgba(0,0,0,.6)}
blockquote cite:before{content:"\2014 \0020"}
blockquote cite a,blockquote cite a:visited{color:rgba(0,0,0,.6)}
blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
@media only screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
h1{font-size:2.75em}
h2{font-size:2.3125em}
h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
h4{font-size:1.4375em}}
table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede}
table thead,table tfoot{background:#f7f8f7;font-weight:bold}
table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
table tr.even,table tr.alt,table tr:nth-of-type(even){background:#f8f8f7}
table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:1.6}
body{tab-size:4}
h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}
h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
.clearfix:before,.clearfix:after,.float-group:before,.float-group:after{content:" ";display:table}
.clearfix:after,.float-group:after{clear:both}
*:not(pre)>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background-color:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed}
pre,pre>code{line-height:1.45;color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;text-rendering:optimizeSpeed}
.keyseq{color:rgba(51,51,51,.8)}
kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background-color:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
.keyseq kbd:first-child{margin-left:0}
.keyseq kbd:last-child{margin-right:0}
.menuseq,.menu{color:rgba(0,0,0,.8)}
b.button:before,b.button:after{position:relative;top:-1px;font-weight:400}
b.button:before{content:"[";padding:0 3px 0 2px}
b.button:after{content:"]";padding:0 2px 0 3px}
p a>code:hover{color:rgba(0,0,0,.9)}
#header,#content,#footnotes,#footer{width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}
#header:before,#header:after,#content:before,#content:after,#footnotes:before,#footnotes:after,#footer:before,#footer:after{content:" ";display:table}
#header:after,#content:after,#footnotes:after,#footer:after{clear:both}
#content{margin-top:1.25em}
#content:before{content:none}
#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #ddddd8}
#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #ddddd8;padding-bottom:8px}
#header .details{border-bottom:1px solid #ddddd8;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap}
#header .details span:first-child{margin-left:-.125em}
#header .details span.email a{color:rgba(0,0,0,.85)}
#header .details br{display:none}
#header .details br+span:before{content:"\00a0\2013\00a0"}
#header .details br+span.author:before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
#header .details br+span#revremark:before{content:"\00a0|\00a0"}
#header #revnumber{text-transform:capitalize}
#header #revnumber:after{content:"\00a0"}
#content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #ddddd8;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}
#toc{border-bottom:1px solid #efefed;padding-bottom:.5em}
#toc>ul{margin-left:.125em}
#toc ul.sectlevel0>li>a{font-style:italic}
#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
#toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
#toc li{line-height:1.3334;margin-top:.3334em}
#toc a{text-decoration:none}
#toc a:active{text-decoration:underline}
#toctitle{color:#7a2518;font-size:1.2em}
@media only screen and (min-width:768px){#toctitle{font-size:1.375em}
body.toc2{padding-left:15em;padding-right:0}
#toc.toc2{margin-top:0!important;background-color:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #efefed;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
#toc.toc2>ul{font-size:.9em;margin-bottom:0}
#toc.toc2 ul ul{margin-left:0;padding-left:1em}
#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
body.toc2.toc-right{padding-left:0;padding-right:15em}
body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #efefed;left:auto;right:0}}
@media only screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
#toc.toc2{width:20em}
#toc.toc2 #toctitle{font-size:1.375em}
#toc.toc2>ul{font-size:.95em}
#toc.toc2 ul ul{padding-left:1.25em}
body.toc2.toc-right{padding-left:0;padding-right:20em}}
#content #toc{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
#content #toc>:first-child{margin-top:0}
#content #toc>:last-child{margin-bottom:0}
#footer{max-width:100%;background-color:rgba(0,0,0,.8);padding:1.25em}
#footer-text{color:rgba(255,255,255,.8);line-height:1.44}
.sect1{padding-bottom:.625em}
@media only screen and (min-width:768px){.sect1{padding-bottom:1.25em}}
.sect1+.sect1{border-top:1px solid #efefed}
#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
#content h1>a.anchor:before,h2>a.anchor:before,h3>a.anchor:before,#toctitle>a.anchor:before,.sidebarblock>.content>.title>a.anchor:before,h4>a.anchor:before,h5>a.anchor:before,h6>a.anchor:before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
table.tableblock>caption.title{white-space:nowrap;overflow:visible;max-width:0}
.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{color:rgba(0,0,0,.85)}
table.tableblock #preamble>.sectionbody>.paragraph:first-of-type p{font-size:inherit}
.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
.admonitionblock>table td.icon{text-align:center;width:80px}
.admonitionblock>table td.icon img{max-width:none}
.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #ddddd8;color:rgba(0,0,0,.6)}
.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
.exampleblock>.content{border-style:solid;border-width:1px;border-color:#e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;-webkit-border-radius:4px;border-radius:4px}
.exampleblock>.content>:first-child{margin-top:0}
.exampleblock>.content>:last-child{margin-bottom:0}
.sidebarblock{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
.sidebarblock>:first-child{margin-top:0}
.sidebarblock>:last-child{margin-bottom:0}
.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
.literalblock pre,.listingblock pre:not(.highlight),.listingblock pre[class="highlight"],.listingblock pre[class^="highlight "],.listingblock pre.CodeRay,.listingblock pre.prettyprint{background:#f7f7f8}
.sidebarblock .literalblock pre,.sidebarblock .listingblock pre:not(.highlight),.sidebarblock .listingblock pre[class="highlight"],.sidebarblock .listingblock pre[class^="highlight "],.sidebarblock .listingblock pre.CodeRay,.sidebarblock .listingblock pre.prettyprint{background:#f2f1f1}
.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{-webkit-border-radius:4px;border-radius:4px;word-wrap:break-word;padding:1em;font-size:.8125em}
.literalblock pre.nowrap,.literalblock pre[class].nowrap,.listingblock pre.nowrap,.listingblock pre[class].nowrap{overflow-x:auto;white-space:pre;word-wrap:normal}
@media only screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}}
@media only screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}}
.literalblock.output pre{color:#f7f7f8;background-color:rgba(0,0,0,.9)}
.listingblock pre.highlightjs{padding:0}
.listingblock pre.highlightjs>code{padding:1em;-webkit-border-radius:4px;border-radius:4px}
.listingblock pre.prettyprint{border-width:0}
.listingblock>.content{position:relative}
.listingblock code[data-lang]:before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:#999}
.listingblock:hover code[data-lang]:before{display:block}
.listingblock.terminal pre .command:before{content:attr(data-prompt);padding-right:.5em;color:#999}
.listingblock.terminal pre .command:not([data-prompt]):before{content:"$"}
table.pyhltable{border-collapse:separate;border:0;margin-bottom:0;background:none}
table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0;line-height:1.45}
table.pyhltable td.code{padding-left:.75em;padding-right:0}
pre.pygments .lineno,table.pyhltable td:not(.code){color:#999;padding-left:0;padding-right:.5em;border-right:1px solid #ddddd8}
pre.pygments .lineno{display:inline-block;margin-right:.25em}
table.pyhltable .linenodiv{background:none!important;padding-right:0!important}
.quoteblock{margin:0 1em 1.25em 1.5em;display:table}
.quoteblock>.title{margin-left:-1.5em;margin-bottom:.75em}
.quoteblock blockquote,.quoteblock blockquote p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}
.quoteblock blockquote{margin:0;padding:0;border:0}
.quoteblock blockquote:before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
.quoteblock .attribution{margin-top:.5em;margin-right:.5ex;text-align:right}
.quoteblock .quoteblock{margin-left:0;margin-right:0;padding:.5em 0;border-left:3px solid rgba(0,0,0,.6)}
.quoteblock .quoteblock blockquote{padding:0 0 0 .75em}
.quoteblock .quoteblock blockquote:before{display:none}
.verseblock{margin:0 1em 1.25em 1em}
.verseblock pre{font-family:"Open Sans","DejaVu Sans",sans;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility}
.verseblock pre strong{font-weight:400}
.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
.quoteblock .attribution br,.verseblock .attribution br{display:none}
.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
.quoteblock.abstract{margin:0 0 1.25em 0;display:block}
.quoteblock.abstract blockquote,.quoteblock.abstract blockquote p{text-align:left;word-spacing:0}
.quoteblock.abstract blockquote:before,.quoteblock.abstract blockquote p:first-of-type:before{display:none}
table.tableblock{max-width:100%;border-collapse:separate}
table.tableblock td>.paragraph:last-child p>p:last-child,table.tableblock th>p:last-child,table.tableblock td>p:last-child{margin-bottom:0}
table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
table.grid-all th.tableblock,table.grid-all td.tableblock{border-width:0 1px 1px 0}
table.grid-all tfoot>tr>th.tableblock,table.grid-all tfoot>tr>td.tableblock{border-width:1px 1px 0 0}
table.grid-cols th.tableblock,table.grid-cols td.tableblock{border-width:0 1px 0 0}
table.grid-all *>tr>.tableblock:last-child,table.grid-cols *>tr>.tableblock:last-child{border-right-width:0}
table.grid-rows th.tableblock,table.grid-rows td.tableblock{border-width:0 0 1px 0}
table.grid-all tbody>tr:last-child>th.tableblock,table.grid-all tbody>tr:last-child>td.tableblock,table.grid-all thead:last-child>tr>th.tableblock,table.grid-rows tbody>tr:last-child>th.tableblock,table.grid-rows tbody>tr:last-child>td.tableblock,table.grid-rows thead:last-child>tr>th.tableblock{border-bottom-width:0}
table.grid-rows tfoot>tr>th.tableblock,table.grid-rows tfoot>tr>td.tableblock{border-width:1px 0 0 0}
table.frame-all{border-width:1px}
table.frame-sides{border-width:0 1px}
table.frame-topbot{border-width:1px 0}
th.halign-left,td.halign-left{text-align:left}
th.halign-right,td.halign-right{text-align:right}
th.halign-center,td.halign-center{text-align:center}
th.valign-top,td.valign-top{vertical-align:top}
th.valign-bottom,td.valign-bottom{vertical-align:bottom}
th.valign-middle,td.valign-middle{vertical-align:middle}
table thead th,table tfoot th{font-weight:bold}
tbody tr th{display:table-cell;line-height:1.6;background:#f7f8f7}
tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
p.tableblock>code:only-child{background:none;padding:0}
p.tableblock{font-size:1em}
td>div.verse{white-space:pre}
ol{margin-left:1.75em}
ul li ol{margin-left:1.5em}
dl dd{margin-left:1.125em}
dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}
ol>li p,ul>li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}
ul.unstyled,ol.unnumbered,ul.checklist,ul.none{list-style-type:none}
ul.unstyled,ol.unnumbered,ul.checklist{margin-left:.625em}
ul.checklist li>p:first-child>.fa-square-o:first-child,ul.checklist li>p:first-child>.fa-check-square-o:first-child{width:1em;font-size:.85em}
ul.checklist li>p:first-child>input[type="checkbox"]:first-child{width:1em;position:relative;top:1px}
ul.inline{margin:0 auto .625em auto;margin-left:-1.375em;margin-right:0;padding:0;list-style:none;overflow:hidden}
ul.inline>li{list-style:none;float:left;margin-left:1.375em;display:block}
ul.inline>li>*{display:block}
.unstyled dl dt{font-weight:400;font-style:normal}
ol.arabic{list-style-type:decimal}
ol.decimal{list-style-type:decimal-leading-zero}
ol.loweralpha{list-style-type:lower-alpha}
ol.upperalpha{list-style-type:upper-alpha}
ol.lowerroman{list-style-type:lower-roman}
ol.upperroman{list-style-type:upper-roman}
ol.lowergreek{list-style-type:lower-greek}
.hdlist>table,.colist>table{border:0;background:none}
.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
td.hdlist1{font-weight:bold;padding-bottom:1.25em}
.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
.colist>table tr>td:first-of-type{padding:0 .75em;line-height:1}
.colist>table tr>td:last-of-type{padding:.25em 0}
.thumb,.th{line-height:0;display:inline-block;border:solid 4px #fff;-webkit-box-shadow:0 0 0 1px #ddd;box-shadow:0 0 0 1px #ddd}
.imageblock.left,.imageblock[style*="float: left"]{margin:.25em .625em 1.25em 0}
.imageblock.right,.imageblock[style*="float: right"]{margin:.25em 0 1.25em .625em}
.imageblock>.title{margin-bottom:0}
.imageblock.thumb,.imageblock.th{border-width:6px}
.imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}
.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
.image.left{margin-right:.625em}
.image.right{margin-left:.625em}
a.image{text-decoration:none;display:inline-block}
a.image object{pointer-events:none}
sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
sup.footnote a,sup.footnoteref a{text-decoration:none}
sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em 0;border-width:1px 0 0 0}
#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;text-indent:-1.05em;margin-bottom:.2em}
#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none}
#footnotes .footnote:last-of-type{margin-bottom:0}
#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
.gist .file-data>table{border:0;background:#fff;width:100%;margin-bottom:0}
.gist .file-data>table td.line-data{width:99%}
div.unbreakable{page-break-inside:avoid}
.big{font-size:larger}
.small{font-size:smaller}
.underline{text-decoration:underline}
.overline{text-decoration:overline}
.line-through{text-decoration:line-through}
.aqua{color:#00bfbf}
.aqua-background{background-color:#00fafa}
.black{color:#000}
.black-background{background-color:#000}
.blue{color:#0000bf}
.blue-background{background-color:#0000fa}
.fuchsia{color:#bf00bf}
.fuchsia-background{background-color:#fa00fa}
.gray{color:#606060}
.gray-background{background-color:#7d7d7d}
.green{color:#006000}
.green-background{background-color:#007d00}
.lime{color:#00bf00}
.lime-background{background-color:#00fa00}
.maroon{color:#600000}
.maroon-background{background-color:#7d0000}
.navy{color:#000060}
.navy-background{background-color:#00007d}
.olive{color:#606000}
.olive-background{background-color:#7d7d00}
.purple{color:#600060}
.purple-background{background-color:#7d007d}
.red{color:#bf0000}
.red-background{background-color:#fa0000}
.silver{color:#909090}
.silver-background{background-color:#bcbcbc}
.teal{color:#006060}
.teal-background{background-color:#007d7d}
.white{color:#bfbfbf}
.white-background{background-color:#fafafa}
.yellow{color:#bfbf00}
.yellow-background{background-color:#fafa00}
span.icon>.fa{cursor:default}
.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
.admonitionblock td.icon .icon-note:before{content:"\f05a";color:#19407c}
.admonitionblock td.icon .icon-tip:before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
.admonitionblock td.icon .icon-warning:before{content:"\f071";color:#bf6900}
.admonitionblock td.icon .icon-caution:before{content:"\f06d";color:#bf3400}
.admonitionblock td.icon .icon-important:before{content:"\f06a";color:#bf0000}
.conum[data-value]{display:inline-block;color:#fff!important;background-color:rgba(0,0,0,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
.conum[data-value] *{color:#fff!important}
.conum[data-value]+b{display:none}
.conum[data-value]:after{content:attr(data-value)}
pre .conum[data-value]{position:relative;top:-.125em}
b.conum *{color:inherit!important}
.conum:not([data-value]):empty{display:none}
dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
h1,h2,p,td.content,span.alt{letter-spacing:-.01em}
p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
p,blockquote,dt,td.content,span.alt{font-size:1.0625rem}
p{margin-bottom:1.25rem}
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
.exampleblock>.content{background-color:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:0 1px 4px #e0e0dc;box-shadow:0 1px 4px #e0e0dc}
.print-only{display:none!important}
@media print{@page{margin:1.25cm .75cm}
*{-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important}
a{color:inherit!important;text-decoration:underline!important}
a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
a[href^="http:"]:not(.bare):after,a[href^="https:"]:not(.bare):after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
abbr[title]:after{content:" (" attr(title) ")"}
pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
thead{display:table-header-group}
svg{max-width:100%}
p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
#toc,.sidebarblock,.exampleblock>.content{background:none!important}
#toc{border-bottom:1px solid #ddddd8!important;padding-bottom:0!important}
.sect1{padding-bottom:0!important}
.sect1+.sect1{border:0!important}
#header>h1:first-child{margin-top:1.25rem}
body.book #header{text-align:center}
body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em 0}
body.book #header .details{border:0!important;display:block;padding:0!important}
body.book #header .details span:first-child{margin-left:0!important}
body.book #header .details br{display:block}
body.book #header .details br+span:before{content:none!important}
body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
.listingblock code[data-lang]:before{display:block}
#footer{background:none!important;padding:0 .9375em}
#footer-text{color:rgba(0,0,0,.6)!important;font-size:.9em}
.hide-on-print{display:none!important}
.print-only{display:block!important}
.hide-for-print{display:none!important}
.show-for-print{display:inherit!important}}
</style>
</head>
<body class="book">
<div id="header">
<h1>Rest API</h1>
</div>
<div id="content">
<div class="sect1">
<h2 id="_spring_cloud_versions">Spring Cloud Versions</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Gets all the available Spring Cloud release trains.</p>
</div>
<div class="sect2">
<h3 id="_curl_request">cURL Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">$ curl 'http://spring-cloud-info.cfapps.io/springcloudversions' -i -X GET \
-H 'Accept: application/json'</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_httpie_request">HTTPie Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">$ http GET 'http://spring-cloud-info.cfapps.io/springcloudversions' \
'Accept:application/json'</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_http_request">HTTP Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">GET /springcloudversions HTTP/1.1
Accept: application/json
Host: spring-cloud-info.cfapps.io</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_response">Response</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">HTTP/1.1 200 OK
Content-Length: 479
Content-Type: application/json;charset=UTF-8
["vGreenwich.SR1","vGreenwich.RELEASE","vGreenwich.RC2","vGreenwich.RC1","vGreenwich.M3","vGreenwich.M2","vGreenwich.M1","vFinchley.SR3","vFinchley.SR2","vFinchley.SR1","vFinchley.RELEASE","vFinchley.RC2","vFinchley.RC1","vFinchley.M9","vFinchley.M8","vFinchley.M7","vFinchley.M6","vFinchley.M5","vFinchley.M3","vFinchley.M2","vFinchley.M1","vEdgware.SR5","vEdgware.SR4","vEdgware.SR3","vEdgware.SR2","vEdgware.SR1","vEdgware.RELEASE","vEdgware.M1","vDalston.SR5","vDalston.SR4"]</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_response_fields">Response Fields</h3>
<table class="tableblock frame-all grid-all spread">
<colgroup>
<col style="width: 33%;">
<col style="width: 33%;">
<col style="width: 33%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Path</th>
<th class="tableblock halign-left valign-top">Type</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>[]</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Array</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">An array versions</p></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_spring_cloud_version_given_spring_boot_version">Spring Cloud Version Given Spring Boot Version</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Gets the Spring Cloud release train version given a Spring Boot version.</p>
</div>
<div class="sect2">
<h3 id="_path_parameters">Path Parameters</h3>
<table class="tableblock frame-all grid-all spread">
<caption class="title">Table 1. /springcloudversion/{bootVersion}</caption>
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Parameter</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>bootVersion</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The Spring Boot version</p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_curl_request_2">cURL Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">$ curl 'http://spring-cloud-info.cfapps.io/springcloudversion/2.1.1.RELEASE' -i -X GET \
-H 'Accept: application/json'</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_httpie_request_2">HTTPie Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">$ http GET 'http://spring-cloud-info.cfapps.io/springcloudversion/2.1.1.RELEASE' \
'Accept:application/json'</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_http_request_2">HTTP Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">GET /springcloudversion/2.1.1.RELEASE HTTP/1.1
Accept: application/json
Host: spring-cloud-info.cfapps.io</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_http_response">HTTP Response</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">HTTP/1.1 200 OK
Content-Length: 31
Content-Disposition: inline;filename=f.txt
Content-Type: application/json;charset=UTF-8
{"version":"Greenwich.RELEASE"}</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_response_fields_2">Response Fields</h3>
<table class="tableblock frame-all grid-all spread">
<colgroup>
<col style="width: 33%;">
<col style="width: 33%;">
<col style="width: 33%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Path</th>
<th class="tableblock halign-left valign-top">Type</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>version</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Spring Cloud version</p></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_spring_cloud_project_versions">Spring Cloud Project Versions</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Get the Spring Cloud project versions for a given Spring Cloud release train.</p>
</div>
<div class="sect2">
<h3 id="_curl_request_3">cURL Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">$ curl 'http://spring-cloud-info.cfapps.io/bomversions/Finchley.SR1' -i -X GET \
-H 'Accept: application/json'</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_httpie_request_3">HTTPie Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">$ http GET 'http://spring-cloud-info.cfapps.io/bomversions/Finchley.SR1' \
'Accept:application/json'</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_http_request_3">HTTP Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">GET /bomversions/Finchley.SR1 HTTP/1.1
Accept: application/json
Host: spring-cloud-info.cfapps.io</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_http_response_2">HTTP Response</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">HTTP/1.1 200 OK
Content-Length: 904
Content-Disposition: inline;filename=f.txt
Content-Type: application/json;charset=UTF-8
{"spring-cloud-cloudfoundry":"2.2.0.BUILD-SNAPSHOT","spring-cloud-openfeign":"2.2.0.BUILD-SNAPSHOT","spring-cloud-task":"2.0.0.RELEASE","spring-cloud-security":"2.2.0.BUILD-SNAPSHOT","spring-cloud-zookeeper":"2.2.0.BUILD-SNAPSHOT","spring-cloud-config":"2.2.0.BUILD-SNAPSHOT","spring-cloud-function":"2.1.0.BUILD-SNAPSHOT","spring-cloud-netflix":"2.2.0.BUILD-SNAPSHOT","spring-cloud-vault":"2.2.0.BUILD-SNAPSHOT","spring-cloud-stream":"Germantown.BUILD-SNAPSHOT","spring-cloud-gcp":"1.1.0.BUILD-SNAPSHOT","spring-cloud-sleuth":"2.2.0.BUILD-SNAPSHOT","spring-cloud-kubernetes":"1.1.0.BUILD-SNAPSHOT","spring-cloud-commons":"2.2.0.BUILD-SNAPSHOT","spring-cloud-aws":"2.2.0.BUILD-SNAPSHOT","spring-cloud-contract":"2.2.0.BUILD-SNAPSHOT","spring-cloud-bus":"2.2.0.BUILD-SNAPSHOT","spring-cloud-gateway":"2.2.0.BUILD-SNAPSHOT","spring-boot":"2.2.0.BUILD-SNAPSHOT","spring-cloud-consul":"2.2.0.BUILD-SNAPSHOT"}</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_upcoming_spring_cloud_releases">Upcoming Spring Cloud Releases</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Gets all the upcoming Spring Cloud releases.</p>
</div>
<div class="sect2">
<h3 id="_curl_request_4">cURL Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">$ curl 'http://spring-cloud-info.cfapps.io/milestones' -i -X GET \
-H 'Accept: application/json'</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_httpie_request_4">HTTPie Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">$ http GET 'http://spring-cloud-info.cfapps.io/milestones' \
'Accept:application/json'</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_http_request_4">HTTP Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">GET /milestones HTTP/1.1
Accept: application/json
Host: spring-cloud-info.cfapps.io</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_http_response_3">HTTP Response</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 57
["Hoxton.RELEASE","Finchley.SR4","Hoxton.M1","Hoxton.M2"]</code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_get_spring_cloud_release_date">Get Spring Cloud Release Date</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Gets the tentative date given an upcoming Spring Cloud release train name.</p>
</div>
<div class="sect2">
<h3 id="_path_parameters_2">Path Parameters</h3>
<table class="tableblock frame-all grid-all spread">
<caption class="title">Table 2. /milestones/{release}/duedate</caption>
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Parameter</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>release</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">The Spring Cloud release train name</p></td>
</tr>
</tbody>
</table>
</div>
<div class="sect2">
<h3 id="_curl_request_5">cURL Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">$ curl 'http://spring-cloud-info.cfapps.io/milestones/Hoxton.RELEASE/duedate' -i -X GET \
-H 'Accept: application/json'</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_httpie_request_5">HTTPie Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">$ http GET 'http://spring-cloud-info.cfapps.io/milestones/Hoxton.RELEASE/duedate' \
'Accept:application/json'</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_http_request_5">HTTP Request</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">GET /milestones/Hoxton.RELEASE/duedate HTTP/1.1
Accept: application/json
Host: spring-cloud-info.cfapps.io</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_http_response_4">HTTP Response</h3>
<div class="listingblock">
<div class="content">
<pre class="highlight nowrap"><code class="language-http" data-lang="http">HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 34
{"dueDate":"2019-07-31T07:00:00Z"}</code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_response_fields_3">Response Fields</h3>
<table class="tableblock frame-all grid-all spread">
<colgroup>
<col style="width: 33%;">
<col style="width: 33%;">
<col style="width: 33%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Path</th>
<th class="tableblock halign-left valign-top">Type</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>dueDate</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Spring Cloud milestone due date</p></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2019-05-07 11:17:02 EDT
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,293 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.json.Json;
import javax.json.JsonBuilderFactory;
import javax.json.JsonObjectBuilder;
import javax.json.JsonValue;
import com.jcabi.github.Coordinates;
import com.jcabi.github.Github;
import com.jcabi.github.Milestone;
import com.jcabi.github.Milestones;
import com.jcabi.github.Repo;
import com.jcabi.github.Repos;
import com.jcabi.http.Request;
import com.jcabi.http.RequestURI;
import com.jcabi.http.Response;
import com.jcabi.http.request.DefaultResponse;
import com.jcabi.http.response.JsonResponse;
import com.jcabi.immutable.Array;
import org.apache.commons.io.IOUtils;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.hamcrest.Matchers;
import org.junit.Test;
import org.springframework.cloud.info.exceptions.SpringCloudVersionNotFoundException;
import org.springframework.core.io.ClassPathResource;
import org.springframework.web.client.RestTemplate;
import static org.assertj.core.api.Assertions.fail;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import static org.springframework.cloud.info.SpringCloudInfoTestData.milestoneStrings;
import static org.springframework.cloud.info.SpringCloudRelease.SPRING_CLOUD_RELEASE_TAGS_PATH;
/**
* @author Ryan Baxter
*/
public class InitializrSpringCloudInfoServiceTests {
@Test
public void getSpringCloudVersionBomRangesMissingTest() {
RestTemplate rest = mock(RestTemplate.class);
Github github = mock(Github.class);
GithubPomReader githubPomReader = mock(GithubPomReader.class);
when(rest.getForObject(anyString(), eq(Map.class))).thenReturn(new HashMap());
InitializrSpringCloudInfoService service = new InitializrSpringCloudInfoService(
rest, github, githubPomReader);
try {
service.getSpringCloudVersion("2.1.0");
fail("Exception should have been thrown");
}
catch (SpringCloudVersionNotFoundException e) {
assertThat(e.getCause().getMessage(), Matchers.startsWith("bom-ranges"));
}
}
@Test
public void getSpringCloudVersionSpringCloudMissingTest() {
RestTemplate rest = mock(RestTemplate.class);
Github github = mock(Github.class);
GithubPomReader githubPomReader = mock(GithubPomReader.class);
Map<String, Map<String, String>> info = new HashMap<>();
info.put("bom-ranges", new HashMap<>());
when(rest.getForObject(anyString(), eq(Map.class))).thenReturn(info);
InitializrSpringCloudInfoService service = new InitializrSpringCloudInfoService(
rest, github, githubPomReader);
try {
service.getSpringCloudVersion("2.1.0");
fail("Exception should have been thrown");
}
catch (SpringCloudVersionNotFoundException e) {
assertThat(e.getCause().getMessage(), Matchers.startsWith("spring-cloud"));
}
}
@Test
public void getSpringCloudReleaseVersionTest() throws Exception {
String bomVersion = "vHoxton.BUILD-SNAPSHOT";
RestTemplate rest = mock(RestTemplate.class);
Github github = mock(Github.class);
GithubPomReader githubPomReader = mock(GithubPomReader.class);
when(githubPomReader.readPomFromUrl(eq(String
.format(SpringCloudRelease.SPRING_CLOUD_STARTER_PARENT_RAW, bomVersion))))
.thenReturn(new MavenXpp3Reader()
.read(new FileReader(new ClassPathResource(
"spring-cloud-starter-parent-pom.xml")
.getFile())));
when(githubPomReader.readPomFromUrl(eq(String.format(
SpringCloudRelease.SPRING_CLOUD_RELEASE_DEPENDENCIES_RAW, bomVersion))))
.thenReturn(new MavenXpp3Reader().read(new FileReader(
new ClassPathResource("spring-cloud-dependencies-pom.xml")
.getFile())));
InitializrSpringCloudInfoService service = spy(
new InitializrSpringCloudInfoService(rest, github, githubPomReader));
doReturn(Arrays.asList(new String[] { bomVersion })).when(service)
.getSpringCloudVersions();
Map<String, String> releaseVersionsResult = service
.getReleaseVersions(bomVersion);
assertThat(releaseVersionsResult,
Matchers.equalTo(SpringCloudInfoTestData.releaseVersions));
}
@Test(expected = SpringCloudVersionNotFoundException.class)
public void getSpringCloudReleaseVersionNotFoundTest() throws Exception {
String bomVersion = "vFooBar.BUILD-SNAPSHOT";
RestTemplate rest = mock(RestTemplate.class);
Github github = mock(Github.class);
GithubPomReader githubPomReader = mock(GithubPomReader.class);
when(githubPomReader.readPomFromUrl(eq(String
.format(SpringCloudRelease.SPRING_CLOUD_STARTER_PARENT_RAW, bomVersion))))
.thenReturn(new MavenXpp3Reader()
.read(new FileReader(new ClassPathResource(
"spring-cloud-starter-parent-pom.xml")
.getFile())));
when(githubPomReader.readPomFromUrl(eq(String.format(
SpringCloudRelease.SPRING_CLOUD_RELEASE_DEPENDENCIES_RAW, bomVersion))))
.thenReturn(new MavenXpp3Reader().read(new FileReader(
new ClassPathResource("spring-cloud-dependencies-pom.xml")
.getFile())));
InitializrSpringCloudInfoService service = spy(
new InitializrSpringCloudInfoService(rest, github, githubPomReader));
doReturn(new ArrayList()).when(service).getSpringCloudVersions();
service.getReleaseVersions(bomVersion);
}
@Test
public void getSpringCloudVersionsTest() throws Exception {
RestTemplate rest = mock(RestTemplate.class);
Github github = mock(Github.class);
GithubPomReader githubPomReader = mock(GithubPomReader.class);
Response response = mock(Response.class);
Request request = mock(Request.class);
RequestURI requestURI = mock(RequestURI.class);
JsonResponse jsonResponse = new JsonResponse(new DefaultResponse(request, 200, "",
new Array<>(),
IOUtils.toByteArray(new ClassPathResource("spring-cloud-versions.json")
.getInputStream())));
doReturn(request).when(requestURI).back();
doReturn(requestURI).when(requestURI).path(eq(SPRING_CLOUD_RELEASE_TAGS_PATH));
doReturn(requestURI).when(request).uri();
doReturn(jsonResponse).when(response).as(eq(JsonResponse.class));
doReturn(response).when(request).fetch();
doReturn(request).when(github).entry();
InitializrSpringCloudInfoService service = spy(
new InitializrSpringCloudInfoService(rest, github, githubPomReader));
assertThat(service.getSpringCloudVersions(),
Matchers.equalTo(SpringCloudInfoTestData.springCloudVersions));
}
@Test
public void getMilestoneDueDateTest() throws Exception {
RestTemplate rest = mock(RestTemplate.class);
Github github = mock(Github.class);
GithubPomReader githubPomReader = mock(GithubPomReader.class);
Repos repos = mock(Repos.class);
Repo repo = mock(Repo.class);
Milestones milestones = mock(Milestones.class);
Iterable iterable = buildMilestonesIterable();
doReturn(iterable).when(milestones).iterate(any(Map.class));
doReturn(milestones).when(repo).milestones();
doReturn(repo).when(repos).get(any(Coordinates.class));
doReturn(repos).when(github).repos();
InitializrSpringCloudInfoService service = spy(
new InitializrSpringCloudInfoService(rest, github, githubPomReader));
assertThat(service.getMilestoneDueDate("Finchley.SR4"),
Matchers.equalTo(new SpringCloudInfoService.Milestone("No Due Date")));
assertThat(service.getMilestoneDueDate("Hoxton.RELEASE"), Matchers
.equalTo(new SpringCloudInfoService.Milestone("2019-07-31T07:00:00Z")));
}
@Test
public void getMilestonesTest() throws Exception {
RestTemplate rest = mock(RestTemplate.class);
Github github = mock(Github.class);
GithubPomReader githubPomReader = mock(GithubPomReader.class);
Repos repos = mock(Repos.class);
Repo repo = mock(Repo.class);
Milestones milestones = mock(Milestones.class);
Iterable iterable = buildMilestonesIterable();
doReturn(iterable).when(milestones).iterate(any(Map.class));
doReturn(milestones).when(repo).milestones();
doReturn(repo).when(repos).get(any(Coordinates.class));
doReturn(repos).when(github).repos();
InitializrSpringCloudInfoService service = spy(
new InitializrSpringCloudInfoService(rest, github, githubPomReader));
assertThat(service.getMilestones(), Matchers.equalTo(milestoneStrings.keySet()));
}
private Iterable<Milestone> buildMilestonesIterable() throws IOException {
JsonBuilderFactory builderFactory = Json.createBuilderFactory(new HashMap<>());
List<Milestone> milestonesList = new ArrayList<>();
for (String m : milestoneStrings.keySet()) {
Milestone milestone = mock(Milestone.class);
String dueDate = milestoneStrings.get(m);
JsonObjectBuilder builder = builderFactory.createObjectBuilder().add("title",
m);
if (dueDate == null) {
builder.add("due_on", JsonValue.NULL);
}
else {
builder.add("due_on", dueDate);
}
doReturn(builder.build()).when(milestone).json();
milestonesList.add(milestone);
}
return new Iterable() {
@Override
public Iterator iterator() {
return milestonesList.iterator();
}
};
}
@Test
public void getSpringCloudVersionTest() throws Exception {
RestTemplate rest = mock(RestTemplate.class);
Github github = mock(Github.class);
GithubPomReader githubPomReader = mock(GithubPomReader.class);
Map<String, String> springCloudVersions = generateSpringCloudData();
Map<String, Map<String, String>> springCloud = new HashMap<>();
springCloud.put("spring-cloud", springCloudVersions);
Map<String, Map<String, Map<String, String>>> info = new HashMap<>();
info.put("bom-ranges", springCloud);
when(rest.getForObject(anyString(), eq(Map.class))).thenReturn(info);
InitializrSpringCloudInfoService service = new InitializrSpringCloudInfoService(
rest, github, githubPomReader);
String version = service.getSpringCloudVersion("2.1.0.RELEASE").getVersion();
assertThat(version, Matchers.equalTo("Greenwich.SR1"));
version = service.getSpringCloudVersion("2.1.4.RELEASE").getVersion();
assertThat(version, Matchers.equalTo("Greenwich.SR1"));
version = service.getSpringCloudVersion("2.1.5.RELEASE").getVersion();
assertThat(version, Matchers.equalTo("Greenwich.BUILD-SNAPSHOT"));
version = service.getSpringCloudVersion("1.5.5.RELEASE").getVersion();
assertThat(version, Matchers.equalTo("Edgware.SR5"));
version = service.getSpringCloudVersion("1.5.21.BUILD-SNAPSHOT").getVersion();
assertThat(version, Matchers.equalTo("Edgware.BUILD-SNAPSHOT"));
}
private Map<String, String> generateSpringCloudData() {
Map<String, String> data = new HashMap<>();
data.put("Edgware.SR5", "Spring Boot >=1.5.0.RELEASE and <=1.5.20.RELEASE");
data.put("Edgware.BUILD-SNAPSHOT",
"Spring Boot >=1.5.21.BUILD-SNAPSHOT and <2.0.0.M1");
data.put("Finchley.M2", "Spring Boot >=2.0.0.M3 and <2.0.0.M5");
data.put("Finchley.M3", "Spring Boot >=2.0.0.M5 and <=2.0.0.M5");
data.put("Finchley.M4", "Spring Boot >=2.0.0.M6 and <=2.0.0.M6");
data.put("Finchley.RC1", "Spring Boot >=2.0.1.RELEASE and <2.0.2.RELEASE");
data.put("Finchley.RC2", "Spring Boot >=2.0.2.RELEASE and <2.0.3.RELEASE");
data.put("Finchley.SR3",
"Spring Boot >=2.0.3.RELEASE and <2.0.999.BUILD-SNAPSHOT");
data.put("Finchley.BUILD-SNAPSHO",
"Spring Boot >=2.0.999.BUILD-SNAPSHOT and <2.1.0.M3");
data.put("Greenwich.M1", "Spring Boot >=2.1.0.M3 and <2.1.0.RELEASE");
data.put("Greenwich.SR1",
"Spring Boot >=2.1.0.RELEASE and <2.1.5.BUILD-SNAPSHOT");
data.put("Greenwich.BUILD-SNAPSHOT", "Spring Boot >=2.1.5.BUILD-SNAPSHOT");
return data;
}
}

View File

@@ -0,0 +1,133 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.cloud.info.SpringCloudInfoService.SpringCloudVersion;
import org.springframework.http.MediaType;
import org.springframework.restdocs.JUnitRestDocumentation;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.springframework.cloud.info.SpringCloudInfoTestData.springCloudVersions;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
import static org.springframework.restdocs.payload.PayloadDocumentation.fieldWithPath;
import static org.springframework.restdocs.payload.PayloadDocumentation.responseFields;
import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName;
import static org.springframework.restdocs.request.RequestDocumentation.pathParameters;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* @author Ryan Baxter
*/
@WebMvcTest(SpringCloudInfoRestController.class)
@RunWith(SpringRunner.class)
public class SpringCloudInfoRestControllerTests {
@Rule
public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();
@Autowired
private MockMvc mockMvc;
@Autowired
private WebApplicationContext context;
@MockBean
SpringCloudInfoService springCloudInfoService;
@Before
public void setUp() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)
.apply(documentationConfiguration(this.restDocumentation).uris()
.withHost("spring-cloud-info.cfapps.io").withPort(80))
.build();
}
@Test
public void version() throws Exception {
doReturn(new SpringCloudVersion("Greenwich.RELEASE")).when(springCloudInfoService)
.getSpringCloudVersion(eq("2.1.1.RELEASE"));
this.mockMvc
.perform(get("/springcloudversion/{bootVersion}", "2.1.1.RELEASE")
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andDo(document("springcloudversion",
pathParameters(parameterWithName("bootVersion")
.description("The Spring Boot version")),
responseFields(fieldWithPath("version")
.description("Spring Cloud version"))));
}
@Test
public void versions() throws Exception {
doReturn(springCloudVersions).when(springCloudInfoService)
.getSpringCloudVersions();
this.mockMvc
.perform(get("/springcloudversions").accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andDo(document("springcloudversions", responseFields(
fieldWithPath("[]").description("An array versions"))));
}
@Test
public void bomVersions() throws Exception {
doReturn(SpringCloudInfoTestData.releaseVersions).when(springCloudInfoService)
.getReleaseVersions(eq("Finchley.SR1"));
this.mockMvc
.perform(get("/bomversions/Finchley.SR1")
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk()).andDo(document("bomversions"));
}
@Test
public void milestones() throws Exception {
doReturn(SpringCloudInfoTestData.milestoneStrings.keySet())
.when(springCloudInfoService).getMilestones();
this.mockMvc.perform(get("/milestones").accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk()).andDo(document("milestones"));
}
@Test
public void milestoneDueDate() throws Exception {
doReturn(new SpringCloudInfoService.Milestone("2019-07-31T07:00:00Z"))
.when(springCloudInfoService).getMilestoneDueDate(eq("Hoxton.RELEASE"));
this.mockMvc
.perform(get("/milestones/{release}/duedate", "Hoxton.RELEASE")
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andDo(document("milestoneduedate",
pathParameters(parameterWithName("release")
.description("The Spring Cloud release train name")),
responseFields(fieldWithPath("dueDate")
.description("Spring Cloud milestone due date"))));
}
}

View File

@@ -0,0 +1,95 @@
/*
* Copyright 2013-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.info;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Ryan Baxter
*/
public class SpringCloudInfoTestData {
public static Map<String, String> releaseVersions = new HashMap<>();
static {
releaseVersions.put("spring-boot", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-aws", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-bus", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-cloudfoundry", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-commons", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-config", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-consul", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-contract", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-function", "2.1.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-gateway", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-gcp", "1.1.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-kubernetes", "1.1.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-netflix", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-openfeign", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-security", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-sleuth", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-stream", "Germantown.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-task", "2.0.0.RELEASE");
releaseVersions.put("spring-cloud-vault", "2.2.0.BUILD-SNAPSHOT");
releaseVersions.put("spring-cloud-zookeeper", "2.2.0.BUILD-SNAPSHOT");
}
public static List<String> springCloudVersions = new ArrayList<>();
static {
springCloudVersions.add("vGreenwich.SR1");
springCloudVersions.add("vGreenwich.RELEASE");
springCloudVersions.add("vGreenwich.RC2");
springCloudVersions.add("vGreenwich.RC1");
springCloudVersions.add("vGreenwich.M3");
springCloudVersions.add("vGreenwich.M2");
springCloudVersions.add("vGreenwich.M1");
springCloudVersions.add("vFinchley.SR3");
springCloudVersions.add("vFinchley.SR2");
springCloudVersions.add("vFinchley.SR1");
springCloudVersions.add("vFinchley.RELEASE");
springCloudVersions.add("vFinchley.RC2");
springCloudVersions.add("vFinchley.RC1");
springCloudVersions.add("vFinchley.M9");
springCloudVersions.add("vFinchley.M8");
springCloudVersions.add("vFinchley.M7");
springCloudVersions.add("vFinchley.M6");
springCloudVersions.add("vFinchley.M5");
springCloudVersions.add("vFinchley.M3");
springCloudVersions.add("vFinchley.M2");
springCloudVersions.add("vFinchley.M1");
springCloudVersions.add("vEdgware.SR5");
springCloudVersions.add("vEdgware.SR4");
springCloudVersions.add("vEdgware.SR3");
springCloudVersions.add("vEdgware.SR2");
springCloudVersions.add("vEdgware.SR1");
springCloudVersions.add("vEdgware.RELEASE");
springCloudVersions.add("vEdgware.M1");
springCloudVersions.add("vDalston.SR5");
springCloudVersions.add("vDalston.SR4");
}
public static Map<String, String> milestoneStrings = new HashMap<>();
static {
milestoneStrings.put("Hoxton.M1", "2019-05-23T07:00:00Z");
milestoneStrings.put("Hoxton.M2", "2019-06-27T07:00:00Z");
milestoneStrings.put("Hoxton.RELEASE", "2019-07-31T07:00:00Z");
milestoneStrings.put("Finchley.SR4", null);
}
}

View File

@@ -0,0 +1,225 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies-parent</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>
<relativePath/>
</parent>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Hoxton.BUILD-SNAPSHOT</version>
<name>spring-cloud-dependencies</name>
<description>Spring Cloud Dependencies</description>
<packaging>pom</packaging>
<properties>
<main.basedir>${basedir}/../..</main.basedir>
<spring-cloud-aws.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-aws.version>
<spring-cloud-bus.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-bus.version>
<spring-cloud-cloudfoundry.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-cloudfoundry.version>
<spring-cloud-commons.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-commons.version>
<spring-cloud-config.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-config.version>
<spring-cloud-consul.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-consul.version>
<spring-cloud-contract.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
<spring-cloud-function.version>2.1.0.BUILD-SNAPSHOT</spring-cloud-function.version>
<spring-cloud-gateway.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-gateway.version>
<spring-cloud-gcp.version>1.1.0.BUILD-SNAPSHOT</spring-cloud-gcp.version>
<spring-cloud-kubernetes.version>1.1.0.BUILD-SNAPSHOT</spring-cloud-kubernetes.version>
<spring-cloud-netflix.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-netflix.version>
<spring-cloud-openfeign.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-openfeign.version>
<spring-cloud-security.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-security.version>
<spring-cloud-sleuth.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-sleuth.version>
<spring-cloud-stream.version>Germantown.BUILD-SNAPSHOT</spring-cloud-stream.version>
<spring-cloud-task.version>2.0.0.RELEASE</spring-cloud-task.version>
<spring-cloud-vault.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-vault.version>
<spring-cloud-zookeeper.version>2.2.0.BUILD-SNAPSHOT</spring-cloud-zookeeper.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- bom dependencies at the bottom so they can be overridden above -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-commons-dependencies</artifactId>
<version>${spring-cloud-commons.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-dependencies</artifactId>
<version>${spring-cloud-netflix.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-dependencies</artifactId>
<version>${spring-cloud-stream.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-task-dependencies</artifactId>
<version>${spring-cloud-task.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-dependencies</artifactId>
<version>${spring-cloud-config.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-dependencies</artifactId>
<version>${spring-cloud-function.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway-dependencies</artifactId>
<version>${spring-cloud-gateway.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-consul-dependencies</artifactId>
<version>${spring-cloud-consul.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-dependencies</artifactId>
<version>${spring-cloud-sleuth.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-vault-dependencies</artifactId>
<version>${spring-cloud-vault.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-zookeeper-dependencies</artifactId>
<version>${spring-cloud-zookeeper.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-security-dependencies</artifactId>
<version>${spring-cloud-security.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-cloudfoundry-dependencies</artifactId>
<version>${spring-cloud-cloudfoundry.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-bus-dependencies</artifactId>
<version>${spring-cloud-bus.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-dependencies</artifactId>
<version>${spring-cloud-contract.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws-dependencies</artifactId>
<version>${spring-cloud-aws.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign-dependencies</artifactId>
<version>${spring-cloud-openfeign.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes-dependencies</artifactId>
<version>${spring-cloud-kubernetes.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-dependencies</artifactId>
<version>${spring-cloud-gcp.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<profiles>
<profile>
<id>spring</id>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</project>

View File

@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>
</parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
<version>Hoxton.BUILD-SNAPSHOT</version>
<name>spring-cloud-starter-parent</name>
<description>Spring Cloud Starter Parent</description>
<packaging>pom</packaging>
<url>https://projects.spring.io/spring-cloud</url>
<organization>
<name>Pivotal Software, Inc.</name>
<url>https://www.spring.io</url>
</organization>
<properties>
<main.basedir>${basedir}/../..</main.basedir>
<spring-cloud.version>Hoxton.BUILD-SNAPSHOT</spring-cloud.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<distributionManagement>
<downloadUrl>https://github.com/spring-cloud</downloadUrl>
<site>
<id>spring-docs</id>
<url>
scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-cloud/docs/${project.artifactId}/${project.version}
</url>
</site>
<repository>
<id>repo.spring.io</id>
<name>Spring Release Repository</name>
<url>https://repo.spring.io/libs-release-local</url>
</repository>
<snapshotRepository>
<id>repo.spring.io</id>
<name>Spring Snapshot Repository</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
</snapshotRepository>
</distributionManagement>
<profiles>
<profile>
<id>spring</id>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>https://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>milestone</id>
<distributionManagement>
<repository>
<id>repo.spring.io</id>
<name>Spring Milestone Repository</name>
<url>https://repo.spring.io/libs-milestone-local</url>
</repository>
</distributionManagement>
</profile>
<profile>
<id>bintray</id>
<distributionManagement>
<repository>
<id>bintray</id>
<name>Jcenter Repository</name>
<url>https://api.bintray.com/maven/spring/jars/org.springframework.cloud:${bintray.package}</url>
</repository>
</distributionManagement>
</profile>
<profile>
<id>central</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
</profiles>
</project>

View File

@@ -0,0 +1,302 @@
[
{
"name":"vGreenwich.SR1",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vGreenwich.SR1",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vGreenwich.SR1",
"commit":{
"sha":"a9c903373dbfe70bf20410d242c026d700886678",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/a9c903373dbfe70bf20410d242c026d700886678"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkdyZWVud2ljaC5TUjE="
},
{
"name":"vGreenwich.RELEASE",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vGreenwich.RELEASE",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vGreenwich.RELEASE",
"commit":{
"sha":"b14ede22cb5de30c31cd50aa240cb321197ef8ef",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/b14ede22cb5de30c31cd50aa240cb321197ef8ef"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkdyZWVud2ljaC5SRUxFQVNF"
},
{
"name":"vGreenwich.RC2",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vGreenwich.RC2",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vGreenwich.RC2",
"commit":{
"sha":"b5a008184bf4bbacab18c6ac3e6f762fe557dbec",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/b5a008184bf4bbacab18c6ac3e6f762fe557dbec"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkdyZWVud2ljaC5SQzI="
},
{
"name":"vGreenwich.RC1",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vGreenwich.RC1",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vGreenwich.RC1",
"commit":{
"sha":"c0f6f9acd93dc50051c880568c934a01c70a2092",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/c0f6f9acd93dc50051c880568c934a01c70a2092"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkdyZWVud2ljaC5SQzE="
},
{
"name":"vGreenwich.M3",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vGreenwich.M3",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vGreenwich.M3",
"commit":{
"sha":"96ff83431ace468e48b5dfa3215d05b25c83e009",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/96ff83431ace468e48b5dfa3215d05b25c83e009"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkdyZWVud2ljaC5NMw=="
},
{
"name":"vGreenwich.M2",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vGreenwich.M2",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vGreenwich.M2",
"commit":{
"sha":"28ba483beb02b874013eb29a3cdeb09c1394998a",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/28ba483beb02b874013eb29a3cdeb09c1394998a"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkdyZWVud2ljaC5NMg=="
},
{
"name":"vGreenwich.M1",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vGreenwich.M1",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vGreenwich.M1",
"commit":{
"sha":"864aad4350d7c07a3b975d0522cb9f0a3442eec0",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/864aad4350d7c07a3b975d0522cb9f0a3442eec0"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkdyZWVud2ljaC5NMQ=="
},
{
"name":"vFinchley.SR3",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.SR3",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.SR3",
"commit":{
"sha":"ce81fa120aef0d00a8c95664b373377eca8de3d7",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/ce81fa120aef0d00a8c95664b373377eca8de3d7"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5LlNSMw=="
},
{
"name":"vFinchley.SR2",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.SR2",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.SR2",
"commit":{
"sha":"34ea6d4e2e751159589113d25f4a6510e4ed374b",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/34ea6d4e2e751159589113d25f4a6510e4ed374b"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5LlNSMg=="
},
{
"name":"vFinchley.SR1",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.SR1",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.SR1",
"commit":{
"sha":"b3e3ab5f0e3badeaf4fab0d432c8881327c00a16",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/b3e3ab5f0e3badeaf4fab0d432c8881327c00a16"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5LlNSMQ=="
},
{
"name":"vFinchley.RELEASE",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.RELEASE",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.RELEASE",
"commit":{
"sha":"f7c64759e431b583d5da11422b7b67a2a323c5c8",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/f7c64759e431b583d5da11422b7b67a2a323c5c8"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5LlJFTEVBU0U="
},
{
"name":"vFinchley.RC2",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.RC2",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.RC2",
"commit":{
"sha":"04dbea43b6f9b42b8b4b68a04b698df56b99b438",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/04dbea43b6f9b42b8b4b68a04b698df56b99b438"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5LlJDMg=="
},
{
"name":"vFinchley.RC1",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.RC1",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.RC1",
"commit":{
"sha":"54ea18c4aee39654dbc4ffdf1808fb79654ec035",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/54ea18c4aee39654dbc4ffdf1808fb79654ec035"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5LlJDMQ=="
},
{
"name":"vFinchley.M9",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.M9",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.M9",
"commit":{
"sha":"2ed336bd8719ef2096390d4cb905c1b779046f0c",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/2ed336bd8719ef2096390d4cb905c1b779046f0c"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5Lk05"
},
{
"name":"vFinchley.M8",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.M8",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.M8",
"commit":{
"sha":"eecc0e960b8b7e2bfd4c67138d4b88df43f9b7b6",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/eecc0e960b8b7e2bfd4c67138d4b88df43f9b7b6"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5Lk04"
},
{
"name":"vFinchley.M7",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.M7",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.M7",
"commit":{
"sha":"2377cfd5386bc985d6d13bf3d9605249d66538e4",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/2377cfd5386bc985d6d13bf3d9605249d66538e4"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5Lk03"
},
{
"name":"vFinchley.M6",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.M6",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.M6",
"commit":{
"sha":"3fbd9d7086627a1453c61e92e79259a2f3c3c8c1",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/3fbd9d7086627a1453c61e92e79259a2f3c3c8c1"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5Lk02"
},
{
"name":"vFinchley.M5",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.M5",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.M5",
"commit":{
"sha":"2be145fa2dc7a8afe5f379920300b029b439ffeb",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/2be145fa2dc7a8afe5f379920300b029b439ffeb"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5Lk01"
},
{
"name":"vFinchley.M3",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.M3",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.M3",
"commit":{
"sha":"e7362196ec5a5d9761a2668e4ef91a3ea3345a61",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/e7362196ec5a5d9761a2668e4ef91a3ea3345a61"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5Lk0z"
},
{
"name":"vFinchley.M2",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.M2",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.M2",
"commit":{
"sha":"fbac1e822c91cf2acfc542a01d2aae758e9143e8",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/fbac1e822c91cf2acfc542a01d2aae758e9143e8"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5Lk0y"
},
{
"name":"vFinchley.M1",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vFinchley.M1",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vFinchley.M1",
"commit":{
"sha":"af82b2d3ba2213dedd431f69e733923fbd81d11e",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/af82b2d3ba2213dedd431f69e733923fbd81d11e"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkZpbmNobGV5Lk0x"
},
{
"name":"vEdgware.SR5",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vEdgware.SR5",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vEdgware.SR5",
"commit":{
"sha":"e913188e3ad1f2eaff7789d2738c5c27a8d81393",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/e913188e3ad1f2eaff7789d2738c5c27a8d81393"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkVkZ3dhcmUuU1I1"
},
{
"name":"vEdgware.SR4",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vEdgware.SR4",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vEdgware.SR4",
"commit":{
"sha":"8a05a2f6b796777671c88b83526b8af79a1f59e1",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/8a05a2f6b796777671c88b83526b8af79a1f59e1"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkVkZ3dhcmUuU1I0"
},
{
"name":"vEdgware.SR3",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vEdgware.SR3",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vEdgware.SR3",
"commit":{
"sha":"c20a51ae0f0066ea221597b5e86b5b55dca1a2af",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/c20a51ae0f0066ea221597b5e86b5b55dca1a2af"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkVkZ3dhcmUuU1Iz"
},
{
"name":"vEdgware.SR2",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vEdgware.SR2",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vEdgware.SR2",
"commit":{
"sha":"759413db879f79656ed9350e04b26dbc7a133992",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/759413db879f79656ed9350e04b26dbc7a133992"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkVkZ3dhcmUuU1Iy"
},
{
"name":"vEdgware.SR1",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vEdgware.SR1",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vEdgware.SR1",
"commit":{
"sha":"35e48e2fd1740ff7ae821fc3e61337c215737bb8",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/35e48e2fd1740ff7ae821fc3e61337c215737bb8"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkVkZ3dhcmUuU1Ix"
},
{
"name":"vEdgware.RELEASE",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vEdgware.RELEASE",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vEdgware.RELEASE",
"commit":{
"sha":"e39b986ec68d0a7b8b4a56281adfb9de096def53",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/e39b986ec68d0a7b8b4a56281adfb9de096def53"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkVkZ3dhcmUuUkVMRUFTRQ=="
},
{
"name":"vEdgware.M1",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vEdgware.M1",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vEdgware.M1",
"commit":{
"sha":"5fce865896095137266c788a84ba9843f6781882",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/5fce865896095137266c788a84ba9843f6781882"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkVkZ3dhcmUuTTE="
},
{
"name":"vDalston.SR5",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vDalston.SR5",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vDalston.SR5",
"commit":{
"sha":"d989c6b96590a8bafef5c0352908fcd4673836db",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/d989c6b96590a8bafef5c0352908fcd4673836db"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkRhbHN0b24uU1I1"
},
{
"name":"vDalston.SR4",
"zipball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/zipball/vDalston.SR4",
"tarball_url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/tarball/vDalston.SR4",
"commit":{
"sha":"28c14699695a76843a6d1c347b1f21055d83ca62",
"url":"https://api.github.com/repos/spring-cloud/spring-cloud-release/commits/28c14699695a76843a6d1c347b1f21055d83ca62"
},
"node_id":"MDM6UmVmMjI0ODI2NjQ6dkRhbHN0b24uU1I0"
}
]

View File

@@ -29,6 +29,7 @@ import org.assertj.core.api.BDDAssertions;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.revwalk.RevCommit;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -311,6 +312,7 @@ public class PostReleaseActionsTests {
}
@Test
@Ignore
public void should_build_and_deploy_guides_when_switch_is_on() throws Exception {
this.properties.getGit().setUpdateSpringGuides(true);
String projects = this.temporaryFolder.getAbsolutePath();