|
25 | 25 | import java.util.List; |
26 | 26 |
|
27 | 27 | import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager; |
| 28 | +import org.assertj.core.api.AssertionsForClassTypes; |
28 | 29 | import org.codehaus.plexus.PlexusContainer; |
29 | 30 | import org.codehaus.plexus.testing.PlexusTest; |
30 | 31 | import org.junit.jupiter.api.Test; |
31 | 32 |
|
| 33 | +import static org.assertj.core.api.Assertions.assertThat; |
32 | 34 | import static org.codehaus.plexus.testing.PlexusExtension.getTestFile; |
33 | 35 | import static org.junit.jupiter.api.Assertions.assertEquals; |
34 | 36 |
|
35 | 37 | @PlexusTest |
36 | 38 | class ArtifactHandlerTest { |
| 39 | + private static final List<String> VALID_PACKAGING_TYPES = List.of( |
| 40 | + "pom", "jar", "test-jar", "maven-plugin", "ejb", "war", "ear", "rar", |
| 41 | + "java-source", "javadoc", "aar", "apk", "bundle", "eclipse-plugin", |
| 42 | + "eclipse-test-plugin", "hpi", "jpi", "kar", "lpkg", "maven-archetype", |
| 43 | + "nar", "par", "sar", "swc", "swf", "zip" |
| 44 | + ); |
| 45 | + |
37 | 46 | @Inject |
38 | 47 | PlexusContainer container; |
39 | 48 |
|
40 | 49 | @Test |
41 | | - @SuppressWarnings("checkstyle:UnusedLocalVariable") |
42 | 50 | void testAptConsistency() throws Exception { |
43 | 51 | File apt = getTestFile("src/site/apt/artifact-handlers.apt"); |
44 | 52 |
|
@@ -74,6 +82,8 @@ void testAptConsistency() throws Exception { |
74 | 82 | String addedToClasspath = trimApt(cols[6]); |
75 | 83 | String includesDependencies = trimApt(cols[7]); |
76 | 84 |
|
| 85 | + assertThat(VALID_PACKAGING_TYPES).contains(packaging); |
| 86 | + |
77 | 87 | ArtifactHandler handler = |
78 | 88 | container.lookup(ArtifactHandlerManager.class).getArtifactHandler(type); |
79 | 89 | assertEquals(handler.getExtension(), extension, type + " extension"); |
|
0 commit comments