Skip to content

Commit 7db7978

Browse files
committed
feat: Maven struct is a possible configuration for creating and updating a MavenGroupRepository
The Nexus API only not returning the Maven block in its GET Response belongs to datadrivers/terraform-provider-nexus#389
1 parent 085bf38 commit 7db7978

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

nexus3/pkg/repository/maven/group_test.go

+11
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,26 @@ func TestMavenGroupRepository(t *testing.T) {
3939
assert.Equal(t, repo.Online, generatedRepo.Online)
4040
assert.Equal(t, repo.Group, generatedRepo.Group)
4141
assert.Equal(t, repo.Storage, generatedRepo.Storage)
42+
// Deactivated because a GET against Nexus API don't return the maven configuration object
43+
// assert.Equal(t, repo.Maven, generatedRepo.Maven)
4244

4345
updatedRepo := repo
4446
updatedRepo.Online = false
47+
contentDisposition := repository.MavenContentDispositionAttachment
48+
maven := repository.Maven{
49+
VersionPolicy: repository.MavenVersionPolicyMixed,
50+
LayoutPolicy: repository.MavenLayoutPolicyStrict,
51+
ContentDisposition: &contentDisposition,
52+
}
53+
updatedRepo.Maven = &maven
4554

4655
err = service.Group.Update(repo.Name, updatedRepo)
4756
assert.Nil(t, err)
4857
generatedRepo, err = service.Group.Get(updatedRepo.Name)
4958
assert.Nil(t, err)
5059
assert.Equal(t, updatedRepo.Online, generatedRepo.Online)
60+
// Deactivated because a GET against Nexus API don't return the maven configuration object
61+
// assert.Equal(t, updatedRepo.Maven, generatedRepo.Maven)
5162

5263
service.Group.Delete(repo.Name)
5364
assert.Nil(t, err)

nexus3/schema/repository/maven.go

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type MavenContentDisposition string
2424
type MavenGroupRepository struct {
2525
Name string `json:"name"`
2626
Online bool `json:"online"`
27+
Maven *Maven `json:"maven,omitempty"` // Optional because a GET against Nexus API don't return the maven configuration object
2728

2829
Group `json:"group"`
2930
Storage `json:"storage"`

0 commit comments

Comments
 (0)