Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Maven struct is a possible configuration for creating and updat… #129

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions nexus3/pkg/repository/maven/group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,26 @@ func TestMavenGroupRepository(t *testing.T) {
assert.Equal(t, repo.Online, generatedRepo.Online)
assert.Equal(t, repo.Group, generatedRepo.Group)
assert.Equal(t, repo.Storage, generatedRepo.Storage)
// Deactivated because a GET against Nexus API don't return the maven configuration object
// assert.Equal(t, repo.Maven, generatedRepo.Maven)

updatedRepo := repo
updatedRepo.Online = false
contentDisposition := repository.MavenContentDispositionAttachment
maven := repository.Maven{
VersionPolicy: repository.MavenVersionPolicyMixed,
LayoutPolicy: repository.MavenLayoutPolicyStrict,
ContentDisposition: &contentDisposition,
}
updatedRepo.Maven = &maven

err = service.Group.Update(repo.Name, updatedRepo)
assert.Nil(t, err)
generatedRepo, err = service.Group.Get(updatedRepo.Name)
assert.Nil(t, err)
assert.Equal(t, updatedRepo.Online, generatedRepo.Online)
// Deactivated because a GET against Nexus API don't return the maven configuration object
// assert.Equal(t, updatedRepo.Maven, generatedRepo.Maven)

service.Group.Delete(repo.Name)
assert.Nil(t, err)
Expand Down
1 change: 1 addition & 0 deletions nexus3/schema/repository/maven.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type MavenContentDisposition string
type MavenGroupRepository struct {
Name string `json:"name"`
Online bool `json:"online"`
Maven *Maven `json:"maven,omitempty"` // Optional because a GET against Nexus API don't return the maven configuration object

Group `json:"group"`
Storage `json:"storage"`
Expand Down