springmockito

    0热度

    1回答

    我尝试测试这种方法: public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { final HttpServletRequest httpRe

    0热度

    1回答

    我想在InterceptorHandler中注入模拟,但我可以配置它。 我有一个这样的拦截器: public class MyInterceptor extends HandlerInterceptorAdapter{ @Autowired private Service service; @Override public boolean preHand

    1热度

    1回答

    我有一个控制器类,我试图用mockito进行测试。 @Controller public class LoginController { final static Logger logger = Logger.getLogger(LoginController.class); private StaffService staffService; @Autowired

    4热度

    2回答

    我想在我的IT中使用Springockito模拟DAO bean。在我的IT中,我必须使用spring context.xml来自动调用一些服务,还需要使用mockApplication.xml来模拟DAO。那么,我怎样才能同时使用xml配置文件呢? @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(loader = Sp

    0热度

    1回答

    我有一个接口,它被注册为ServiceLocatorFactoryBean的一部分。这个接口的主要目的是充当工厂。 http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.html 我有“自动连接”这种接口在不同的

    0热度

    1回答

    我正在使用一个开源项目petclininc,它遵循Spring MVC模式使用spring mocking服务编写Junit测试用例。 我开始用一个独立的控制器 @Controller @SessionAttributes("visit") public class VisitController { private final ClinicService clinicServic

    0热度

    1回答

    我们正在使用Spring Boot Rest Api进行服务调用。 我猜测我们可以使用Junit进行单元测试用例。 但是需要知道其他合适的工具或框架来模拟除了junit以外的Spring Boot Rest Api()的单元测试。

    0热度

    1回答

    嗨,我有类RestClientUtil执行所有与服务器的连接相关的操作,并获得使用休息服务的响应。当我试图嘲笑我的restClientUtil其嘲笑成功,但当我试图调用这个类的方法时,方法将返回响应为null.when我看到restClientUtil变量在调试模式下,这个类的属性像pbsOrderStatusUrlsellerCode等等都是空的可能是因为这个原因响应即将空,因此,请告诉我,这是

    0热度

    1回答

    我正在为我的项目创建junit测试用例。我有下面的代码,在那里我想创建一个模拟,我正在使用junit和mockito核心jar。我试着用下面的代码, System.setProperty("path.to.properties", "dummyPathToProperties"); //invalid Path Properties properties = mock(Properties.cl

    0热度

    1回答

    我写单元测试的一个控制器,这里是我的代码 public class MyController { @Inject private MyService myService; public List<Car> getCars() { myService.getCars(); } } public class MyServiceIm