From 3c21f1ea6be4e36500aefe554e107981a35c0174 Mon Sep 17 00:00:00 2001 From: norand94 Date: Thu, 2 Jun 2022 18:27:44 +0400 Subject: [PATCH] feat: method JanitorSessionTestHelper.ValidateSessionNotExist checks status code --- internal/testhelpers/janitor_session_test_helper.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/testhelpers/janitor_session_test_helper.go b/internal/testhelpers/janitor_session_test_helper.go index 2d1b682bb81..23e74cadbae 100644 --- a/internal/testhelpers/janitor_session_test_helper.go +++ b/internal/testhelpers/janitor_session_test_helper.go @@ -6,6 +6,8 @@ import ( "testing" "time" + "github.com/ory/fosite" + "github.com/stretchr/testify/require" "github.com/ory/hydra/client" @@ -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) }