org.mockito.exceptions.misusing.PotentialStubbingProblem:
Strict stubbing argument mismatch. Please check:
- this invocation of 'execute' method:
stringRedisTemplate.execute(
mutableLeaderboardScript,
[user_cached:11:dailyAttempts, user_cached:11:totalAttempts, leaderboard:lb-123:mutable, user_cached:11, global-leaderboard-stream, local-leaderboard-stream],
"11",
"10.0",
"5",
"2",
"[ZZ]",
"20",
"lb-123",
"ZZ"
);
-> at com.jzargo.leaderboardmicroservice.service.LeaderboardServiceImpl.executeScoreChange(LeaderboardServiceImpl.java:139)
- has following stubbing(s) with different arguments:
1. stringRedisTemplate.execute(null, [], null);
-> at com.jzargo.leaderboardmicroservice.unit.LeaderboardServiceUnitTest.test_increaseUserScore_Successful
или null, который зависит от мягкой аннотации, тот же результат будет получен, если я заменю Any() на ArgumentMatchers.any(), Any(Object[].class) и (Object[]) Any()
У меня есть метод тестирования с использованием Mockito 5 [code] @Test public void test_increaseUserScore_Successful() throws CannotCreateCachedUserException { when(cachedUserRepository .existsById(anyLong()) ).thenReturn(true);
verify(stringRedisTemplate, times(1)) .execute(eq(mutableLeaderboardScript), anyList(), any(Object.class)); } [/code] Я либо принимаю исключение PotentialStuppingProblem: [code]org.mockito.exceptions.misusing.PotentialStubbingProblem: Strict stubbing argument mismatch. Please check: - this invocation of 'execute' method: stringRedisTemplate.execute( mutableLeaderboardScript, [user_cached:11:dailyAttempts, user_cached:11:totalAttempts, leaderboard:lb-123:mutable, user_cached:11, global-leaderboard-stream, local-leaderboard-stream], "11", "10.0", "5", "2", "[ZZ]", "20", "lb-123", "ZZ" ); -> at com.jzargo.leaderboardmicroservice.service.LeaderboardServiceImpl.executeScoreChange(LeaderboardServiceImpl.java:139) - has following stubbing(s) with different arguments: 1. stringRedisTemplate.execute(null, [], null); -> at com.jzargo.leaderboardmicroservice.unit.LeaderboardServiceUnitTest.test_increaseUserScore_Successful [/code] или null, который зависит от мягкой аннотации, тот же результат будет получен, если я заменю Any() на ArgumentMatchers.any(), Any(Object[].class) и (Object[]) Any()