Skip to content

Commit 3167922

Browse files
Use flexible error assertions in XSW tests
1 parent b28c88c commit 3167922

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

service_provider_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,8 +1433,8 @@ func TestXswPermutationSevenIsRejected(t *testing.T) {
14331433
req.PostForm.Set("SAMLResponse", string(respStr))
14341434
_, err = s.ParseResponse(&req, []string{"ONELOGIN_4fee3b046395c4e751011e97f8900b5273d56685"})
14351435
// It's the assertion signature that can't be verified. The error message is generic and always mentions Response
1436-
assert.Check(t, is.Error(err.(*InvalidResponseError).PrivateErr,
1437-
"cannot validate signature on Assertion: Signature could not be verified"))
1436+
assert.Check(t, is.ErrorContains(err.(*InvalidResponseError).PrivateErr,
1437+
"cannot validate signature on Assertion:"))
14381438
}
14391439

14401440
func TestXswPermutationEightIsRejected(t *testing.T) {
@@ -1464,8 +1464,8 @@ func TestXswPermutationEightIsRejected(t *testing.T) {
14641464
req.PostForm.Set("SAMLResponse", string(respStr))
14651465
_, err = s.ParseResponse(&req, []string{"ONELOGIN_4fee3b046395c4e751011e97f8900b5273d56685"})
14661466
// It's the assertion signature that can't be verified. The error message is generic and always mentions Response
1467-
assert.Check(t, is.Error(err.(*InvalidResponseError).PrivateErr,
1468-
"cannot validate signature on Assertion: Signature could not be verified"))
1467+
assert.Check(t, is.ErrorContains(err.(*InvalidResponseError).PrivateErr,
1468+
"cannot validate signature on Assertion:"))
14691469
}
14701470

14711471
func TestXswPermutationNineIsRejected(t *testing.T) {

0 commit comments

Comments
 (0)