Skip to content

Commit

Permalink
feat: method JanitorSessionTestHelper.ValidateSessionNotExist checks …
Browse files Browse the repository at this point in the history
…status code
  • Loading branch information
norand94 committed Jul 4, 2022
1 parent ecf4925 commit 3c21f1e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/testhelpers/janitor_session_test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"testing"
"time"

"github.com/ory/fosite"

"github.com/stretchr/testify/require"

"github.com/ory/hydra/client"
Expand Down Expand Up @@ -39,6 +41,8 @@ func (h *JanitorSessionTestHelper) ValidateSessionExist(t *testing.T, ctx contex
func (h *JanitorSessionTestHelper) ValidateSessionNotExist(t *testing.T, ctx context.Context, id string) {
session, err := h.reg.ConsentManager().GetRememberedLoginSession(ctx, id)
require.Error(t, err)
rpcErr := fosite.ErrorToRFC6749Error(err)
require.Equal(t, fosite.ErrNotFound.StatusCode(), rpcErr.StatusCode())
require.Nil(t, session)
}

Expand Down

0 comments on commit 3c21f1e

Please sign in to comment.