|
17 | 17 | import org.junit.jupiter.params.provider.ValueSource; |
18 | 18 |
|
19 | 19 | import static org.junit.jupiter.api.Assertions.assertEquals; |
| 20 | +import static org.junit.jupiter.api.Assertions.assertFalse; |
20 | 21 | import static org.junit.jupiter.api.Assertions.assertThrows; |
21 | 22 | import static org.junit.jupiter.api.Assertions.assertTrue; |
22 | 23 | import static org.junit.jupiter.api.Assertions.fail; |
@@ -64,6 +65,28 @@ void testBundleFolder() { |
64 | 65 | assertTrue(new File(outputFolder, "one-client-api-v1.3.5.yaml").exists()); |
65 | 66 | assertTrue(new File(outputFolder, "one-client-api-v2.0.0.yaml").exists()); |
66 | 67 | assertTrue(new File(outputFolder, "another-client-api-v1.7.9.yaml").exists()); |
| 68 | + assertFalse(new File(outputFolder, "test-client-api-v1.1.1.yaml").exists()); |
| 69 | + } |
| 70 | + |
| 71 | + @Test |
| 72 | + @SneakyThrows |
| 73 | + void testBundleFolder_whenExcludesExists() { |
| 74 | + var outputFolder = "target/test-bundle-bundler"; |
| 75 | + |
| 76 | + BundleMojo mojo = new BundleMojo(); |
| 77 | + |
| 78 | + mojo.setInput(new File(getClass().getResource("/bundler").getFile())); |
| 79 | + mojo.setOutput(new File(outputFolder)); |
| 80 | + mojo.setIncludes(new String[]{"**/*-api-v*.yaml"}); |
| 81 | + mojo.setExcludes(new String[]{"**/folder/**"}); |
| 82 | + mojo.setVersionFileName(true); |
| 83 | + mojo.setFlattenOutput(true); |
| 84 | + mojo.execute(); |
| 85 | + |
| 86 | + assertFalse(new File(outputFolder, "one-client-api-v1.3.5.yaml").exists()); |
| 87 | + assertFalse(new File(outputFolder, "one-client-api-v2.0.0.yaml").exists()); |
| 88 | + assertFalse(new File(outputFolder, "another-client-api-v1.7.9.yaml").exists()); |
| 89 | + assertTrue(new File(outputFolder, "test-client-api-v1.1.1.yaml").exists()); |
67 | 90 | } |
68 | 91 |
|
69 | 92 | @Test |
|
0 commit comments