本文介绍了Spring Boot是否可以与cumulage-jvm一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Spring Boot,因为它删除了所有无聊的内容,让我集中精力处理我的代码,但是所有测试示例都使用junit,并且我想使用黄瓜吗?

I'm using spring boot as it removes all the boring stuff and let's me focus on my code, but all the test examples use junit and I want to use cucumber?

有人可以指出我正确的方向来获取黄瓜和弹簧来启动东西,进行所有的自动配置和接线,并让我的步骤定义使用自动接线的豆子来做事吗?

Can someone point me in the right direction to get cucumber and spring to start things up, do all the auto config and wiring and let my step definitions use auto wired beans to do stuff?

推荐答案

尝试在您的步骤定义类中使用以下内容:

Try to use the following on your step definition class:

@ContextConfiguration(classes = YourBootApplication.class,
                      loader = SpringApplicationContextLoader.class)
@RunWith(SpringJUnit4ClassRunner.class)
public class MySteps {
    //...
}

还请确保您已经打开了黄瓜弹簧模块您的课程路径。

Also make sure you have the cucumber-spring module on your classpath.

这篇关于Spring Boot是否可以与cumulage-jvm一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-27 04:03
查看更多