Skip to content

Commit 9f123c1

Browse files
authored
Avoid warning about unthrown exception (#2217)
* Avoid warning about unthrown exception
1 parent af6b706 commit 9f123c1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Diff for: impl/maven-impl/src/test/java/org/apache/maven/impl/ModelVersionParserTest.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,21 @@
2424
import org.junit.jupiter.api.Test;
2525

2626
import static org.junit.jupiter.api.Assertions.assertEquals;
27+
import static org.junit.jupiter.api.Assertions.assertNotNull;
2728
import static org.junit.jupiter.api.Assertions.assertNull;
2829
import static org.junit.jupiter.api.Assertions.assertTrue;
2930
import static org.junit.jupiter.api.Assertions.fail;
3031

31-
/**
32-
*/
3332
public class ModelVersionParserTest {
3433

3534
private final DefaultModelVersionParser versionParser = new DefaultModelVersionParser(new GenericVersionScheme());
3635

37-
private VersionParserException parseInvalid(String constraint) {
36+
private void parseInvalid(String constraint) {
3837
try {
3938
versionParser.parseVersionConstraint(constraint);
4039
fail("expected exception for constraint " + constraint);
41-
return null;
4240
} catch (VersionParserException e) {
43-
return e;
41+
assertNotNull(e.getMessage());
4442
}
4543
}
4644

0 commit comments

Comments
 (0)