Merge branch '2.2.x'
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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+\\..*");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user