Skip to content

Commit 2286d79

Browse files
author
norand94
committed
feat: method JanitorSessionTestHelper.ValidateSessionNotExist checks status code
1 parent 59fd3eb commit 2286d79

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/testhelpers/janitor_session_test_helper.go

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"testing"
77
"time"
88

9+
"github.com/ory/fosite"
10+
911
"github.com/stretchr/testify/require"
1012

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

0 commit comments

Comments
 (0)