squakez commented on code in PR #5126: URL: https://github.com/apache/camel-k/pull/5126#discussion_r1477800792
########## pkg/apis/camel/v1/maven_types_support_test.go: ########## @@ -140,3 +140,51 @@ func TestMarshalPluginPropertiesWithNestedProps(t *testing.T) { assert.Contains(t, result, "<prop2>baz</prop2>") assert.Contains(t, result, "<v2>bar</v2>") } + +func TestArtifactToString(t *testing.T) { + a1 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact", a1.GetDependencyID()) + + a2 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + Type: "jar", + Version: "1.2", + Classifier: "foo", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact:jar:foo:1.2", a2.GetDependencyID()) + + a3 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + Version: "1.2", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact:1.2", a3.GetDependencyID()) + + a4 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + Type: "jar", + Classifier: "foo", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact:jar:foo", a4.GetDependencyID()) + + a5 := MavenArtifact{ + GroupID: "org.mygroup", + ArtifactID: "my-artifact", + Classifier: "foo", + Version: "1.2", + } + assert.Equal(t, "mvn:org.mygroup:my-artifact::foo:1.2", a5.GetDependencyID()) Review Comment: the `::` looks suspicious. Are they really expected that way? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org