-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmaven_test.go
48 lines (45 loc) · 1.1 KB
/
maven_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package main
import (
"testing"
)
func TestArtifactName(t *testing.T) {
type args struct {
config MavenConfig
}
tests := []struct {
name string
args args
want string
}{
{"simple", args{simpleConfig}, "my-artifact-1.0.0.jar"},
{"classifier", args{classifierConfig}, "my-artifact-1.0.0-javadoc.jar"},
{"zip", args{zipConfig}, "my-artifact-1.0.0.zip"},
{"allMavenKeys", args{allMavenKeysConfig}, "my-artifact-1.0.0-source.zip"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.args.config.ArtifactName(); got != tt.want {
t.Errorf("ArtifactName() = %v, want %v", got, tt.want)
}
})
}
}
func TestArtifactUrl(t *testing.T) {
type args struct {
config MavenConfig
}
tests := []struct {
name string
args args
want string
}{
{"simple", args{simpleConfig}, "https://repo.maven.apache.org/maven2/com/group/my/my-artifact/1.0.0/my-artifact-1.0.0.jar"},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.args.config.ArtifactUrl(); got != tt.want {
t.Errorf("ArtifactUrl() = %v, want %v", got, tt.want)
}
})
}
}