Skip to content

Commit aed406d

Browse files
authored
feat: spring cache not match data, real call (#450)
1 parent 6896d4e commit aed406d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arex-instrumentation/dynamic/arex-cache/src/main/java/io/arex/inst/cache/spring/SpringCacheInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static boolean onEnter(@Advice.Argument(2) Method method,
5353
extractor = new DynamicClassExtractor(method, args, keyExpression, null);
5454
}
5555
if (extractor != null && ContextManager.needReplay()) {
56-
mockResult = extractor.replay();
56+
mockResult = extractor.replayOrRealCall();
5757
return mockResult != null && mockResult.notIgnoreMockResult();
5858
}
5959
if (ContextManager.needRecord()) {

arex-instrumentation/dynamic/arex-cache/src/test/java/io/arex/inst/cache/spring/SpringCacheInstrumentationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void methodAdvice() {
5757
void onEnter() throws NoSuchMethodException {
5858
Method test1 = TestArexMock.class.getDeclaredMethod("testWithCacheableAnnotation", String.class, int.class);
5959
try(MockedConstruction ignored = Mockito.mockConstruction(DynamicClassExtractor.class, ((extractor, context) -> {
60-
Mockito.when(extractor.replay()).thenReturn(MockResult.success("test"));
60+
Mockito.when(extractor.replayOrRealCall()).thenReturn(MockResult.success("test"));
6161
}))) {
6262
Method testReturnVoid = TestArexMock.class.getDeclaredMethod("testReturnVoid");
6363
boolean actualResult = SpringCacheInstrumentation.SpringCacheAdvice.onEnter(testReturnVoid, null, null, null);

0 commit comments

Comments
 (0)