Merge branch '2.2.x'

This commit is contained in:
spencergibb
2021-02-08 13:51:56 -05:00
6 changed files with 56 additions and 5 deletions

View File

@@ -113,7 +113,11 @@ public class DeployerApplication {
String getDefaultVersion() {
try (InputStream in = new ClassPathResource("META-INF/cli-version.txt").getInputStream()) {
return StreamUtils.copyToString(in, StandardCharsets.UTF_8);
String version = StreamUtils.copyToString(in, StandardCharsets.UTF_8);
if (StringUtils.hasText(version)) {
version = version.trim();
}
return version;
}
catch (IOException e) {
ReflectionUtils.rethrowRuntimeException(e);

View File

@@ -66,6 +66,6 @@ public class DeployerApplicationTests {
public void defaultVersionReadFromFile() {
String defaultVersion = new DeployerApplication("--launcher.deploy=foo,bar").getDefaultVersion();
// starts with one or more digits then a .
assertThat(defaultVersion).isNotBlank().containsPattern("^\\d+\\..*");
assertThat(defaultVersion).isNotBlank().doesNotContainAnyWhitespaces().containsPattern("^\\d+\\..*");
}
}