document IllegalArgumentException thrown by CTR
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java
index 6003756..0fdb62c 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java
@@ -56,6 +56,9 @@
*
* @param coords The artifact coordinates in the format
* {@code <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>}, must not be {@code null}.
+ *
+ * @throws IllegalArgumentException If the artifact coordinates found in {@code coords} do not match the expected
+ * format.
*/
public DefaultArtifact( String coords )
{
@@ -69,6 +72,9 @@
* @param coords The artifact coordinates in the format
* {@code <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>}, must not be {@code null}.
* @param properties The artifact properties, may be {@code null}.
+ *
+ * @throws IllegalArgumentException If the artifact coordinates found in {@code coords} do not match the expected
+ * format.
*/
public DefaultArtifact( String coords, Map<String, String> properties )
{
diff --git a/maven-resolver-api/src/test/java/org/eclipse/aether/artifact/DefaultArtifactTest.java b/maven-resolver-api/src/test/java/org/eclipse/aether/artifact/DefaultArtifactTest.java
index d8ac40c..49773ab 100644
--- a/maven-resolver-api/src/test/java/org/eclipse/aether/artifact/DefaultArtifactTest.java
+++ b/maven-resolver-api/src/test/java/org/eclipse/aether/artifact/DefaultArtifactTest.java
@@ -91,11 +91,17 @@
}
@Test( expected = IllegalArgumentException.class )
- public void testDefaultArtifactBadString()
+ public void testDefaultArtifactContainsGroupAndArtifactOnly()
{
new DefaultArtifact( "gid:aid" );
}
+ @Test( expected = IllegalArgumentException.class )
+ public void testDefaultArtifactContainsGroupOnly()
+ {
+ new DefaultArtifact( "gid" );
+ }
+
@Test
public void testImmutability()
{