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 Jun 2, 2022
1 parent 59fd3eb commit 2286d79
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 2286d79

Please sign in to comment.