You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Modernized my test suite for AuthJwtIntegrationTest.java] to account for the significant architectural refactors that have happened since. Existing tests were mostly fine, needed to update the setup a bit, but changes here mainly involved added tests that should now be there (to reflect Spring Security chain filters, JWT auth filter, and so on).
// THIS IS INTEGRATION TEST FOR THE JWT ASPECT [1] -- for main stuff.
35
37
38
+
/* 2026-01-14-NOTE:+DEBUG:
39
+
Comments below are complete gibberish and I have no idea what i was going on about.
40
+
These "AuthJwtIntegrationTests" are more "Security contract tests" than anything specific (name could be changed to something else
41
+
like AuthJwtRedisIntegrationTests or just AuthIntegrationTests, maybe I should do that?).
42
+
- Basically test security around /graphql, /auth, and /api (boundary behavior, anonymous vs authenticated).
43
+
44
+
New tests that were added on this day as part of modernizing this test suite to be up-to-date:
45
+
- GraphQL access w/o Authorization header
46
+
- REST access w/o Authorization header
47
+
- Malformed JWT rejection (invalid JWT)
48
+
- Missing refresh token validation
49
+
- Expired JWT rejection even when it exists in Redis
50
+
- Refresh token rotation under concurrent reuse (race-condition safety)
51
+
- Refresh-status correctness
52
+
- User/token binding validation
53
+
^ these all go from ~test 6 onwards.
54
+
*/
55
+
36
56
// 2025-11-26-NOTE: Remember, efficient setup of my Integration Tests are not high priority while I rush to project MVP completion. I can return to this later!
37
57
/* 2025-11-26-NOTE(S):
38
58
- @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) to load the FULL Spring context like it's a real server.
@@ -44,39 +64,16 @@ the dummy HTTP client for testing (use it to hit the HTTP endpoints, send header
44
64
This basically allows you to control the order of tests which is useful when your tests build upon the same DB. (This can
45
65
be a nice alternative to what I was doing prior, which was flushing the DataBase between tests; this is probably better).
0 commit comments