Skip to content

Commit

Permalink
Really fix the expected test output issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronAtDuo committed Jul 19, 2023
1 parent 2dd6570 commit 9841c10
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions duouniversal/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ var nilErrErrorMsg = "Did not recieve expected error"
var nilResultErrorMsg = "Result should be nil but is not"
var sigIsInvalid = "failed to verify jws signature: failed to verify message: failed to match hmac signature"
var notSatisfiedError = "%s not satisfied"
var notSatisfiedErrorMismatch = "%s not satisfied: values do not match"
var duoCode = "abcdefghijklmnopqrstuvwxyz"
var badUsername = "badUsername"

Expand Down Expand Up @@ -333,13 +334,13 @@ func TestExchangeCodeFor2FAVerifyJWT(t *testing.T) {
nonce string
want string
}{
{"badPreferredUsername", "preferred_username", badUsername, 0, "", fmt.Sprintf(notSatisfiedError, "\"preferred_username\"")},
{"badPreferredUsername", "preferred_username", badUsername, 0, "", fmt.Sprintf(notSatisfiedErrorMismatch, "\"preferred_username\"")},
{"badAud", "aud", badClientId, 0, "", fmt.Sprintf(notSatisfiedError, "aud")},
{"badIat", "iat", "", time.Now().Add(time.Second * time.Duration(expirationTime)).Unix(), "", fmt.Sprintf(notSatisfiedError, "iat")},
{"badExp", "exp", "", time.Now().Unix() - expirationTime, "", fmt.Sprintf(notSatisfiedError, "exp")},
{"badIss", "iss", fmt.Sprintf(tokenEndpoint, badApiHost), 0, "", fmt.Sprintf(notSatisfiedError, "\"iss\"")},
{"noNonce", "", "", 0, nonce, fmt.Sprintf(notSatisfiedError, "\"nonce\"")},
{"badNonce", "nonce", badNonce, 0, nonce, fmt.Sprintf(notSatisfiedError, "\"nonce\"")},
{"badIss", "iss", fmt.Sprintf(tokenEndpoint, badApiHost), 0, "", fmt.Sprintf(notSatisfiedErrorMismatch, "\"iss\"")},
{"noNonce", "", "", 0, nonce, fmt.Sprintf(notSatisfiedErrorMismatch, "\"nonce\"")},
{"badNonce", "nonce", badNonce, 0, nonce, fmt.Sprintf(notSatisfiedErrorMismatch, "\"nonce\"")},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
Expand Down

0 comments on commit 9841c10

Please sign in to comment.