Skip to content

Commit 1c6624d

Browse files
committed
Merge branch '2.6.x' into 2.7.x
Closes gh-32097
2 parents a912b72 + f7fba30 commit 1c6624d

File tree

2 files changed

+5
-4
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src

2 files changed

+5
-4
lines changed

spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/main/java/org/springframework/boot/jarmode/layertools/Context.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -55,7 +55,8 @@ class Context {
5555
* @param workingDir the working directory
5656
*/
5757
Context(File archiveFile, File workingDir) {
58-
Assert.state(isExistingFile(archiveFile) && isJarOrWar(archiveFile), "Unable to find source archive");
58+
Assert.state(isExistingFile(archiveFile), "Unable to find source archive");
59+
Assert.state(isJarOrWar(archiveFile), "Source archive " + archiveFile + " must end with .jar or .war");
5960
this.archiveFile = archiveFile;
6061
this.workingDir = workingDir;
6162
this.relativeDir = deduceRelativeDir(archiveFile.getParentFile(), this.workingDir);

spring-boot-project/spring-boot-tools/spring-boot-jarmode-layertools/src/test/java/org/springframework/boot/jarmode/layertools/ContextTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@ void createWhenSourceIsNotJarOrWarThrowsException() throws Exception {
5555
File zip = new File(this.temp, "test.zip");
5656
Files.createFile(zip.toPath());
5757
assertThatIllegalStateException().isThrownBy(() -> new Context(zip, this.temp))
58-
.withMessage("Unable to find source archive");
58+
.withMessageContaining("test.zip must end with .jar or .war");
5959
}
6060

6161
@Test

0 commit comments

Comments
 (0)