Skip to content

Commit 51f7046

Browse files
author
Vincent Potucek
committed
add test assertion to resolve @SuppressWarnings("checkstyle:UnusedLocalVariable")
1 parent 96efade commit 51f7046

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

impl/maven-core/src/test/java/org/apache/maven/artifact/handler/ArtifactHandlerTest.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,28 @@
2525
import java.util.List;
2626

2727
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
28+
import org.assertj.core.api.AssertionsForClassTypes;
2829
import org.codehaus.plexus.PlexusContainer;
2930
import org.codehaus.plexus.testing.PlexusTest;
3031
import org.junit.jupiter.api.Test;
3132

33+
import static org.assertj.core.api.Assertions.assertThat;
3234
import static org.codehaus.plexus.testing.PlexusExtension.getTestFile;
3335
import static org.junit.jupiter.api.Assertions.assertEquals;
3436

3537
@PlexusTest
3638
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+
3746
@Inject
3847
PlexusContainer container;
3948

4049
@Test
41-
@SuppressWarnings("checkstyle:UnusedLocalVariable")
4250
void testAptConsistency() throws Exception {
4351
File apt = getTestFile("src/site/apt/artifact-handlers.apt");
4452

@@ -74,6 +82,8 @@ void testAptConsistency() throws Exception {
7482
String addedToClasspath = trimApt(cols[6]);
7583
String includesDependencies = trimApt(cols[7]);
7684

85+
assertThat(VALID_PACKAGING_TYPES).contains(packaging);
86+
7787
ArtifactHandler handler =
7888
container.lookup(ArtifactHandlerManager.class).getArtifactHandler(type);
7989
assertEquals(handler.getExtension(), extension, type + " extension");

0 commit comments

Comments
 (0)