Commit fdd15424fce06834ca0224895ddf6ca5352455de
1 parent
f6601ab6
171 fix(protection): 修复HTTP接口签名 API重复请求问题
Showing
1 changed file
with
1 additions
and
2 deletions
yudao-framework/yudao-spring-boot-starter-protection/src/test/java/cn/iocoder/yudao/framework/signature/core/ApiSignatureTest.java
| ... | ... | @@ -63,13 +63,12 @@ public class ApiSignatureTest { |
| 63 | 63 | when(request.getReader()).thenReturn(new BufferedReader(new StringReader("test"))); |
| 64 | 64 | // mock 方法 |
| 65 | 65 | when(signatureRedisDAO.getAppSecret(eq(appId))).thenReturn(appSecret); |
| 66 | + when(signatureRedisDAO.setNonce(eq(appId), eq(nonce), eq(120), eq(TimeUnit.SECONDS))).thenReturn(true); | |
| 66 | 67 | |
| 67 | 68 | // 调用 |
| 68 | 69 | boolean result = apiSignatureAspect.verifySignature(apiSignature, request); |
| 69 | 70 | // 断言结果 |
| 70 | 71 | assertTrue(result); |
| 71 | - // 断言调用 | |
| 72 | - verify(signatureRedisDAO).setNonce(eq(appId), eq(nonce), eq(120), eq(TimeUnit.SECONDS)); | |
| 73 | 72 | } |
| 74 | 73 | |
| 75 | 74 | } |
| 76 | 75 | \ No newline at end of file | ... | ... |