From 33b913ac90bda6b3c161fe8de652e4f7327c4cc0 Mon Sep 17 00:00:00 2001 From: Jim Anderson Date: Fri, 15 Dec 2023 10:44:10 -0600 Subject: [PATCH] add test for RandomStorage for missing session state --- src/test/java/com/auth0/RandomStorageTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/com/auth0/RandomStorageTest.java b/src/test/java/com/auth0/RandomStorageTest.java index 7ffd766..49a4af7 100644 --- a/src/test/java/com/auth0/RandomStorageTest.java +++ b/src/test/java/com/auth0/RandomStorageTest.java @@ -24,6 +24,13 @@ public void shouldAcceptBothNullStates() { assertThat(validState, is(true)); } + @Test + public void shouldFailIfSessionStateIsNullButCurrentStateNotNull() { + MockHttpServletRequest req = new MockHttpServletRequest(); + boolean validState = RandomStorage.checkSessionState(req, "12345"); + assertThat(validState, is(false)); + } + @Test public void shouldCheckAndRemoveInvalidState() { MockHttpServletRequest req = new MockHttpServletRequest();