JdbcTemplate类型的方法query(String,ResultSetExtractor< T>)不适用于参数(String,BeanPropertyRowMapper) [英] The method query(String, ResultSetExtractor<T>) in the type JdbcTemplate is not applicable for the arguments (String, BeanPropertyRowMapper)

查看:643
本文介绍了JdbcTemplate类型的方法query(String,ResultSetExtractor< T>)不适用于参数(String,BeanPropertyRowMapper)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的编译问题.我无法解决此问题.同样的代码可以在另一个项目中正常工作

I have a compile problem which is strange. I am not able to fix this. The same peice of code works fine in another project

org.mockito.Mockito.when(jdbcTemplate.query(org.mockito.Matchers.anyString(), 
    org.mockito.Matchers.any(BeanPropertyRowMapper.class))).thenReturn(SOMELIST);

我收到错误消息

The method query(String, ResultSetExtractor<T>) in the type JdbcTemplate is not applicable for the arguments (String, BeanPropertyRowMapper)

但是,当我这样做时,我没有得到任何错误.但是我没想到这一点.

But When I do this, I do not get any error. But I am not expecting this.

BeanPropertyRowMapper<MyClass> mapper = 
    new BeanPropertyRowMapper<MyClass>(MyClass.class);
org.mockito.Mockito.when(jdbcTemplate.query(org.mockito.Matchers.anyString(), 
    mapper)).thenReturn(SOMELIST);

我不确定这是否是Eclipse问题.感谢您的帮助.

I am not sure if this is an Eclipse problem. Appreciate your help on this.

推荐答案

由于 查看全文

相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆