diff --git a/internal/oidc/auth/auth_handler_test.go b/internal/oidc/auth/auth_handler_test.go index fe38f2ab..2a38a221 100644 --- a/internal/oidc/auth/auth_handler_test.go +++ b/internal/oidc/auth/auth_handler_test.go @@ -637,12 +637,13 @@ func TestAuthorizationEndpoint(t *testing.T) { require.Empty(t, rsp.Header().Values("Location")) } - if test.wantBodyJSON != "" { + switch { + case test.wantBodyJSON != "": require.JSONEq(t, test.wantBodyJSON, rsp.Body.String()) - } else if test.wantBodyStringWithLocationInHref { + case test.wantBodyStringWithLocationInHref: anchorTagWithLocationHref := fmt.Sprintf("Found.\n\n", html.EscapeString(actualLocation)) require.Equal(t, anchorTagWithLocationHref, rsp.Body.String()) - } else { + default: require.Equal(t, test.wantBodyString, rsp.Body.String()) }