@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = {JedisConnectConfig.class})
public class HyperLogLogTests {
@Autowired
private RedisTemplate<String, String> redisTemplate;
@Resource(name="redisTemplate")
private HyperLogLogOperations<String, String> opsForHyperLog;
@Test
void testPfCount() {
}
}
Вызвано: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Предполагается, что компонент с именем «redisTemplate» имеет тип «org.springframework.data.redis.core.HyperLogLogOperations», но фактически был тип 'org.springframework.data.redis.core.RedisTemplate'
, но
@Resource(name="redisTemplate")
private HyperLogLogOperations<String, String> opsForHyperLog;
работает.
почему?