feat(phase3): 收口父子单与全链路验收
This commit is contained in:
@@ -46,9 +46,14 @@ class TokenSessionStoreTest {
|
||||
ValueOperations<String, String> values = mock(ValueOperations.class);
|
||||
when(redis.opsForValue()).thenReturn(values);
|
||||
|
||||
store.store("jti-1", 42L, "raw-refresh", Duration.ofMinutes(30), Duration.ofDays(7));
|
||||
store.store("jti-1", 42L, Set.of("ADMIN"), Set.of("order:read"),
|
||||
"raw-refresh", Duration.ofMinutes(30), Duration.ofDays(7));
|
||||
|
||||
verify(values).set("baiyue:auth:access:jti-1", "42", Duration.ofMinutes(30));
|
||||
verify(values).set(eq("baiyue:auth:access:jti-1"),
|
||||
org.mockito.ArgumentMatchers.argThat(value -> value.contains("\"version\":1")
|
||||
&& value.contains("\"userId\":42")
|
||||
&& value.contains("ADMIN") && value.contains("order:read")),
|
||||
eq(Duration.ofMinutes(30)));
|
||||
verify(values).set(org.mockito.ArgumentMatchers.startsWith("baiyue:auth:refresh:"),
|
||||
org.mockito.ArgumentMatchers.contains("\"userId\":42"), org.mockito.ArgumentMatchers.eq(Duration.ofDays(7)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user