Skip to content

Commit

Permalink
fixup! tests (saml): minor code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jimlambrt committed Sep 9, 2023
1 parent 65cb44c commit f3a06b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion saml/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (sp *ServiceProvider) internalParser(
for _, xcert := range kd.KeyInfo.X509Data.X509Certificates {
parsed, err := parseX509Certificate(xcert.Data)
if err != nil {
return nil, err
return nil, fmt.Errorf("%s: unable to parse cert: %w", op, err)
}
certStore.Roots = append(certStore.Roots, parsed) // append works just fine with a nil slice
}
Expand Down
5 changes: 3 additions & 2 deletions saml/response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func TestServiceProvider_ParseResponse(t *testing.T) {
}

func TestServiceProvider_ParseResponseCustomACS(t *testing.T) {
t.Parallel()
r := require.New(t)

fakeTime, err := time.Parse("2006-01-02", "2015-07-15")
Expand Down Expand Up @@ -151,9 +152,9 @@ func TestServiceProvider_ParseResponseCustomACS(t *testing.T) {
)
if c.err == "" {
require.NoError(t, err)
} else {
require.ErrorContains(t, err, c.err)
return
}
require.ErrorContains(t, err, c.err)
})
}

Expand Down

0 comments on commit f3a06b4

Please sign in to comment.