Wip upgrade deps (#252)
This commit is contained in:
committed by
GitHub
parent
886e3513d5
commit
b3c4ef2cdc
@@ -12,7 +12,7 @@
|
||||
<properties>
|
||||
<docs.main>spring-cloud-release-tools</docs.main>
|
||||
<main.basedir>${basedir}/..</main.basedir>
|
||||
<maven.plugin.plugin.version>3.4</maven.plugin.plugin.version>
|
||||
<maven.plugin.plugin.version>3.6.4</maven.plugin.plugin.version>
|
||||
<configprops.inclusionPattern>releaser.*</configprops.inclusionPattern>
|
||||
</properties>
|
||||
<dependencies>
|
||||
|
||||
14
pom.xml
14
pom.xml
@@ -30,16 +30,18 @@
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
|
||||
<spring-cloud-bom.version>Hoxton.SR6</spring-cloud-bom.version>
|
||||
<spring-cloud-bom.version>2021.0.1</spring-cloud-bom.version>
|
||||
<jcabi-github.version>1.1.2</jcabi-github.version>
|
||||
<jsch-agent.version>0.0.9</jsch-agent.version>
|
||||
<org.eclipse.jgit-version>5.1.3.201810200350-r</org.eclipse.jgit-version>
|
||||
<hibernate-validator.version>7.0.4.Final</hibernate-validator.version>
|
||||
<!--Matches JGit in Boot:-->
|
||||
<org.eclipse.jgit-version>5.12.0.202106070339-r</org.eclipse.jgit-version>
|
||||
<!-- Versions plugin uses this version -->
|
||||
<maven-model.version>3.6.3</maven-model.version>
|
||||
<versions-maven-plugin.version>2.8.1</versions-maven-plugin.version>
|
||||
<handlebars.version>4.2.0</handlebars.version>
|
||||
<maven-model.version>3.8.5</maven-model.version>
|
||||
<versions-maven-plugin.version>2.10.0</versions-maven-plugin.version>
|
||||
<handlebars.version>4.3.0</handlebars.version>
|
||||
<initializr-metadata.version>0.12.0</initializr-metadata.version>
|
||||
<awaitility.version>4.0.3</awaitility.version>
|
||||
<awaitility.version>4.2.0</awaitility.version>
|
||||
<sagan-site.version>1.0.0-SNAPSHOT</sagan-site.version>
|
||||
<javax.json.version>1.1.4</javax.json.version>
|
||||
<jopt-simple.version>5.0.4</jopt-simple.version>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
<cloudfoundry-client.version>4.12.0.RELEASE</cloudfoundry-client.version>
|
||||
<cloudfoundry-client.version>5.7.0.RELEASE</cloudfoundry-client.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -43,6 +43,11 @@
|
||||
<artifactId>jsch.agentproxy.sshagent</artifactId>
|
||||
<version>${jsch-agent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jgit</groupId>
|
||||
<artifactId>org.eclipse.jgit.ssh.jsch</artifactId>
|
||||
<version>${org.eclipse.jgit-version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jcraft</groupId>
|
||||
<artifactId>jsch.agentproxy.jsch</artifactId>
|
||||
|
||||
@@ -181,8 +181,8 @@ class CachingRepos implements Repos, Closeable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean exists(Coordinates coords) throws IOException {
|
||||
return this.delegate.exists(coords);
|
||||
public boolean exists(Coordinates coordinates) throws IOException {
|
||||
return delegate.exists(coordinates);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,10 +20,10 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import edu.emory.mathcs.backport.java.util.Collections;
|
||||
import org.apache.maven.model.Model;
|
||||
import org.assertj.core.api.BDDAssertions;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
package releaser.internal.buildsystem;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import edu.emory.mathcs.backport.java.util.Arrays;
|
||||
import org.apache.maven.model.Model;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
@@ -37,13 +37,13 @@ import static org.mockito.Mockito.never;
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class PropertyVersionChangerTests {
|
||||
class PropertyVersionChangerTests {
|
||||
|
||||
@Mock
|
||||
PropertyStorer propertyStorer;
|
||||
|
||||
@Test
|
||||
public void should_set_version_when_project_matches_property_name() throws Exception {
|
||||
void should_set_version_when_project_matches_property_name() {
|
||||
PropertyVersionChanger changer = new PropertyVersionChanger(model(), versions(), null, null,
|
||||
this.propertyStorer);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class PropertyVersionChangerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_not_set_version_when_project_doesnt_match_property_name() throws Exception {
|
||||
void should_not_set_version_when_project_doesnt_match_property_name() {
|
||||
PropertyVersionChanger changer = new PropertyVersionChanger(nonMatchingModel(), versions(), null, null,
|
||||
this.propertyStorer);
|
||||
|
||||
@@ -64,7 +64,7 @@ public class PropertyVersionChangerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void should_not_set_version_when_project_matches_property_name_and_versions_are_the_same() throws Exception {
|
||||
void should_not_set_version_when_project_matches_property_name_and_versions_are_the_same() {
|
||||
PropertyVersionChanger changer = new PropertyVersionChanger(modelWithSameValues(), versions(), null, null,
|
||||
this.propertyStorer);
|
||||
|
||||
@@ -80,8 +80,8 @@ public class PropertyVersionChangerTests {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private Set<Project> allProjects() {
|
||||
return new HashSet<>(Arrays.asList(new Project[] { project("spring-cloud-aws", "1.2.0.BUILD-SNAPSHOT"),
|
||||
project("spring-cloud-sleuth", "1.2.0.BUILD-SNAPSHOT") }));
|
||||
return new HashSet<>(Arrays.asList(project("spring-cloud-aws", "1.2.0.BUILD-SNAPSHOT"),
|
||||
project("spring-cloud-sleuth", "1.2.0.BUILD-SNAPSHOT")));
|
||||
}
|
||||
|
||||
Project project(String name, String value) {
|
||||
|
||||
@@ -19,6 +19,7 @@ package releaser.internal.spring;
|
||||
import java.io.Closeable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -29,7 +30,6 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import edu.emory.mathcs.backport.java.util.Collections;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import releaser.internal.ReleaserProperties;
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
package releaser.internal.docs;
|
||||
|
||||
import edu.emory.mathcs.backport.java.util.Collections;
|
||||
import java.util.Collections;
|
||||
|
||||
import releaser.internal.ReleaserProperties;
|
||||
import releaser.internal.git.ProjectGitHandler;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ package releaser.internal.spring;
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
// @RunWith(MockitoJUnitRunner.class)
|
||||
// @ExtendWith(MockitoExtension.class)
|
||||
@SuppressWarnings("unchecked")
|
||||
public class OptionsProcessorTests {
|
||||
|
||||
@@ -45,7 +45,7 @@ public class OptionsProcessorTests {
|
||||
* Consumer<Args> function) { return new Task(name, shortName, header, description,
|
||||
* function); }
|
||||
*
|
||||
* @Before public void setup() { this.optionsProcessor = new
|
||||
* @BeforeEach public void setup() { this.optionsProcessor = new
|
||||
* OptionsProcessor(this.releaser, new ReleaserProperties(), this.tasks); Task.stepSkipper
|
||||
* = () -> false; }
|
||||
*
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
|
||||
package releaser.internal.buildsystem;
|
||||
|
||||
import edu.emory.mathcs.backport.java.util.Collections;
|
||||
import java.util.Collections;
|
||||
|
||||
import releaser.internal.ReleaserProperties;
|
||||
|
||||
public class MavenBomParserAccessor {
|
||||
|
||||
@@ -13,12 +13,12 @@
|
||||
<artifactId>spring-cloud-info</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven-core.version>3.6.1</maven-core.version>
|
||||
<maven-core.version>3.8.5</maven-core.version>
|
||||
<javax.json-api.version>1.1.4</javax.json-api.version>
|
||||
<maven-model.version>3.6.3</maven-model.version>
|
||||
<maven-model.version>3.8.5</maven-model.version>
|
||||
<scs.version>3.1.6.RELEASE</scs.version>
|
||||
<spring-asciidoctor-extensions.version>0.2.0-RELEASE</spring-asciidoctor-extensions.version>
|
||||
<spring-cloud-bom.version>2021.0.0</spring-cloud-bom.version>
|
||||
<spring-cloud-bom.version>2021.0.1</spring-cloud-bom.version>
|
||||
<spring-rest-docs.version>2.0.6.RELEASE</spring-rest-docs.version>
|
||||
</properties>
|
||||
|
||||
@@ -113,17 +113,17 @@
|
||||
<plugin>
|
||||
<groupId>org.asciidoctor</groupId>
|
||||
<artifactId>asciidoctor-maven-plugin</artifactId>
|
||||
<version>${asciidoctor-maven-plugin.version}</version>
|
||||
<version>2.2.2</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.spring.asciidoctor</groupId>
|
||||
<artifactId>spring-asciidoctor-extensions</artifactId>
|
||||
<version>${spring-asciidoctor-extensions.version}</version>
|
||||
<version>0.6.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.restdocs</groupId>
|
||||
<artifactId>spring-restdocs-asciidoctor</artifactId>
|
||||
<version>${spring-rest-docs.version}</version>
|
||||
<version>2.0.6.RELEASE</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
||||
@@ -21,7 +21,6 @@ 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 java.util.stream.Collectors;
|
||||
@@ -46,12 +45,13 @@ 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.junit.jupiter.api.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.assertThatExceptionOfType;
|
||||
import static org.assertj.core.api.Assertions.fail;
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
@@ -67,10 +67,10 @@ import static org.springframework.cloud.info.SpringCloudRelease.SPRING_CLOUD_REL
|
||||
/**
|
||||
* @author Ryan Baxter
|
||||
*/
|
||||
public class InitializrSpringCloudInfoServiceTests {
|
||||
class InitializrSpringCloudInfoServiceTests {
|
||||
|
||||
@Test
|
||||
public void getSpringCloudVersionBomRangesMissingTest() {
|
||||
void getSpringCloudVersionBomRangesMissingTest() {
|
||||
RestTemplate rest = mock(RestTemplate.class);
|
||||
Github github = mock(Github.class);
|
||||
GithubPomReader githubPomReader = mock(GithubPomReader.class);
|
||||
@@ -86,7 +86,7 @@ public class InitializrSpringCloudInfoServiceTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSpringCloudVersionSpringCloudMissingTest() {
|
||||
void getSpringCloudVersionSpringCloudMissingTest() {
|
||||
RestTemplate rest = mock(RestTemplate.class);
|
||||
Github github = mock(Github.class);
|
||||
GithubPomReader githubPomReader = mock(GithubPomReader.class);
|
||||
@@ -104,48 +104,51 @@ public class InitializrSpringCloudInfoServiceTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSpringCloudReleaseVersionTest() throws Exception {
|
||||
void getSpringCloudReleaseVersionTest() throws Exception {
|
||||
String bomVersion = "v2020.0.0-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())));
|
||||
.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())));
|
||||
.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();
|
||||
doReturn(Arrays.asList(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
|
||||
void getSpringCloudReleaseVersionNotFoundTest() {
|
||||
assertThatExceptionOfType(SpringCloudVersionNotFoundException.class).isThrownBy(() -> {
|
||||
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 {
|
||||
void getSpringCloudVersionsTest() throws Exception {
|
||||
RestTemplate rest = mock(RestTemplate.class);
|
||||
Github github = mock(Github.class);
|
||||
GithubPomReader githubPomReader = mock(GithubPomReader.class);
|
||||
@@ -167,7 +170,7 @@ public class InitializrSpringCloudInfoServiceTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMilestoneDueDateTest() throws Exception {
|
||||
void getMilestoneDueDateTest() throws Exception {
|
||||
RestTemplate rest = mock(RestTemplate.class);
|
||||
Github github = mock(Github.class);
|
||||
GithubPomReader githubPomReader = mock(GithubPomReader.class);
|
||||
@@ -188,7 +191,7 @@ public class InitializrSpringCloudInfoServiceTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getMilestonesTest() throws Exception {
|
||||
void getMilestonesTest() throws Exception {
|
||||
RestTemplate rest = mock(RestTemplate.class);
|
||||
Github github = mock(Github.class);
|
||||
GithubPomReader githubPomReader = mock(GithubPomReader.class);
|
||||
@@ -222,16 +225,11 @@ public class InitializrSpringCloudInfoServiceTests {
|
||||
doReturn(builder.build()).when(milestone).json();
|
||||
milestonesList.add(milestone);
|
||||
}
|
||||
return new Iterable() {
|
||||
@Override
|
||||
public Iterator iterator() {
|
||||
return milestonesList.iterator();
|
||||
}
|
||||
};
|
||||
return (Iterable) () -> milestonesList.iterator();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSpringCloudVersionTest() throws Exception {
|
||||
void getSpringCloudVersionTest() throws Exception {
|
||||
RestTemplate rest = mock(RestTemplate.class);
|
||||
Github github = mock(Github.class);
|
||||
GithubPomReader githubPomReader = mock(GithubPomReader.class);
|
||||
|
||||
@@ -18,18 +18,17 @@ package org.springframework.cloud.info;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
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.restdocs.RestDocumentationContextProvider;
|
||||
import org.springframework.restdocs.RestDocumentationExtension;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
@@ -50,11 +49,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
|
||||
* @author Ryan Baxter
|
||||
*/
|
||||
@WebMvcTest(SpringCloudInfoRestController.class)
|
||||
@RunWith(SpringRunner.class)
|
||||
public class SpringCloudInfoRestControllerTests {
|
||||
@ExtendWith(RestDocumentationExtension.class)
|
||||
class SpringCloudInfoRestControllerTests {
|
||||
|
||||
@Rule
|
||||
public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();
|
||||
|
||||
@MockBean
|
||||
SpringCloudInfoService springCloudInfoService;
|
||||
@@ -65,16 +62,17 @@ public class SpringCloudInfoRestControllerTests {
|
||||
@Autowired
|
||||
private WebApplicationContext context;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
@BeforeEach
|
||||
void setUp(RestDocumentationContextProvider restDocumentation) {
|
||||
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)
|
||||
.apply(documentationConfiguration(this.restDocumentation).uris().withHost("spring-cloud-info.cfapps.io")
|
||||
.apply(documentationConfiguration(restDocumentation).uris()
|
||||
.withHost("spring-cloud-info.cfapps.io")
|
||||
.withPort(80))
|
||||
.build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void version() throws Exception {
|
||||
void version() throws Exception {
|
||||
doReturn(new SpringCloudVersion("Greenwich.RELEASE")).when(springCloudInfoService)
|
||||
.getSpringCloudVersion(eq("2.1.1.RELEASE"));
|
||||
this.mockMvc
|
||||
@@ -87,16 +85,18 @@ public class SpringCloudInfoRestControllerTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void versions() throws Exception {
|
||||
doReturn(springCloudVersions.stream().map(v -> v.replaceFirst("v", "")).collect(Collectors.toList()))
|
||||
void versions() throws Exception {
|
||||
doReturn(springCloudVersions.stream().map(v -> v.replaceFirst("v", ""))
|
||||
.collect(Collectors.toList()))
|
||||
.when(springCloudInfoService).getSpringCloudVersions();
|
||||
this.mockMvc.perform(get("/springcloudversions").accept(MediaType.APPLICATION_JSON)).andExpect(status().isOk())
|
||||
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 {
|
||||
void bomVersions() throws Exception {
|
||||
doReturn(SpringCloudInfoTestData.releaseVersions).when(springCloudInfoService)
|
||||
.getReleaseVersions(eq("Finchley.SR1"));
|
||||
this.mockMvc.perform(get("/bomversions/Finchley.SR1").accept(MediaType.APPLICATION_JSON))
|
||||
@@ -104,14 +104,16 @@ public class SpringCloudInfoRestControllerTests {
|
||||
}
|
||||
|
||||
@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())
|
||||
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 {
|
||||
void milestoneDueDate() throws Exception {
|
||||
doReturn(new SpringCloudInfoService.Milestone("2019-07-31")).when(springCloudInfoService)
|
||||
.getMilestoneDueDate(eq("Hoxton.RELEASE"));
|
||||
this.mockMvc.perform(get("/milestones/{release}/duedate", "Hoxton.RELEASE").accept(MediaType.APPLICATION_JSON))
|
||||
|
||||
Reference in New Issue
Block a user