Skip to content

Commit dac4591

Browse files
committed
Maven enforcer plugin: Add support for Changed, Unmerged, Unknown git file filters
Signed-off-by: tvallin <[email protected]>
1 parent f603e32 commit dac4591

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

common/common/src/test/java/io/helidon/build/common/FileUtilsTest.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024 Oracle and/or its affiliates.
2+
* Copyright (c) 2023, 2025 Oracle and/or its affiliates.
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.
@@ -32,11 +32,13 @@
3232
import org.junit.jupiter.api.condition.EnabledOnOs;
3333
import org.junit.jupiter.api.condition.OS;
3434

35+
import static io.helidon.build.common.FileUtils.ensureFile;
3536
import static io.helidon.build.common.FileUtils.list;
3637
import static io.helidon.build.common.FileUtils.newZipFileSystem;
3738
import static io.helidon.build.common.FileUtils.unique;
3839
import static io.helidon.build.common.FileUtils.unzip;
3940
import static io.helidon.build.common.FileUtils.zip;
41+
import static io.helidon.build.common.FileUtils.isSubModule;
4042
import static io.helidon.build.common.Unchecked.unchecked;
4143
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
4244
import static java.nio.file.attribute.PosixFilePermission.GROUP_EXECUTE;
@@ -155,6 +157,16 @@ void testE2ePermissions2() throws IOException {
155157
zipAndUnzip(zipDir);
156158
}
157159

160+
@Test
161+
void testIsSubmodule() throws IOException {
162+
Path blue = TestFiles.targetDir(FileUtilsTest.class).resolve("test-classes/vfs/blue");
163+
Path submodule = ensureFile(outputDir.resolve("submodule"));
164+
Files.write(submodule, "[submodule ...".getBytes());
165+
166+
assertThat(isSubModule(submodule), is(true));
167+
assertThat(isSubModule(blue), is(false));
168+
}
169+
158170
private static void readZipFileContent(Path zip, Consumer<Path> consumer) {
159171
try (FileSystem fs = newZipFileSystem(zip)) {
160172
Path root = fs.getRootDirectories().iterator().next();

0 commit comments

Comments
 (0)