Skip to content

Commit

Permalink
Add test for Getting application, ad users is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Sep 24, 2024
1 parent 88c7e94 commit 2b82031
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api/applications/applications_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -810,12 +810,17 @@ func TestGetApplication_AllFieldsAreSet(t *testing.T) {
// Setup
_, controllerTestUtils, _, _, _, _, _, _ := setupTest(t, true, true)

adGroups, adUsers := []string{uuid.New().String()}, []string{uuid.New().String()}
readerAdGroups, readerAdUsers := []string{uuid.New().String()}, []string{uuid.New().String()}
parameters := buildApplicationRegistrationRequest(
anApplicationRegistration().
WithName("any-name").
WithRepository("https://github.com/Equinor/any-repo").
WithSharedSecret("Any secret").
WithAdGroups([]string{"a6a3b81b-34gd-sfsf-saf2-7986371ea35f"}).
WithAdGroups(adGroups).
WithAdUsers(adUsers).
WithReaderAdGroups(readerAdGroups).
WithReaderAdUsers(readerAdUsers).
WithConfigBranch("abranch").
WithRadixConfigFullName("a/custom-radixconfig.yaml").
WithConfigurationItem("ci").
Expand All @@ -836,7 +841,10 @@ func TestGetApplication_AllFieldsAreSet(t *testing.T) {

assert.Equal(t, "https://github.com/Equinor/any-repo", application.Registration.Repository)
assert.Equal(t, "Any secret", application.Registration.SharedSecret)
assert.Equal(t, []string{"a6a3b81b-34gd-sfsf-saf2-7986371ea35f"}, application.Registration.AdGroups)
assert.Equal(t, adGroups, application.Registration.AdGroups)
assert.Equal(t, adUsers, application.Registration.AdUsers)
assert.Equal(t, readerAdGroups, application.Registration.ReaderAdGroups)
assert.Equal(t, readerAdUsers, application.Registration.ReaderAdUsers)
assert.Equal(t, "not-existing-test-radix-email@equinor.com", application.Registration.Creator)
assert.Equal(t, "abranch", application.Registration.ConfigBranch)
assert.Equal(t, "a/custom-radixconfig.yaml", application.Registration.RadixConfigFullName)
Expand Down

0 comments on commit 2b82031

Please sign in to comment.