-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Banner check on filesystem containing special chars
- Loading branch information
Showing
4 changed files
with
34 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
core/deployment/src/test/java/io/quarkus/deployment/pkg/steps/BannerProcessorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.quarkus.deployment.pkg.steps; | ||
|
||
import io.quarkus.deployment.steps.BannerProcessor; | ||
import org.assertj.core.util.Files; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.net.URL; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
public class BannerProcessorTest { | ||
|
||
class MyBannerProcessor extends BannerProcessor { | ||
public boolean test(String file) throws Exception { | ||
return this.isQuarkusCoreBanner(new URL("jar", null, 0, file)); | ||
} | ||
} | ||
|
||
@Test | ||
public void checkQuarkusCoreBannerOnFilesystemWithSpecialCharacters() throws Exception { | ||
MyBannerProcessor processor = new MyBannerProcessor(); | ||
|
||
assertFalse(processor.test("file:///tmp/Descărcări/test/something!")); | ||
assertFalse(processor.test(Files.currentFolder() + "/src/test/resources/test/Descărcări/without-class.jar!")); | ||
assertTrue(processor.test(Files.currentFolder() + "/src/test/resources/test/Descărcări/with-class.jar!")); | ||
} | ||
} |
Binary file not shown.
Binary file added
BIN
+168 Bytes
core/deployment/src/test/resources/test/Descărcări/without-class.jar
Binary file not shown.