Skip to content

Instantly share code, notes, and snippets.

@willmenn
Last active June 29, 2016 23:56
Show Gist options
  • Save willmenn/00c735c4d7c41076aa33adc21b60e6ea to your computer and use it in GitHub Desktop.
Save willmenn/00c735c4d7c41076aa33adc21b60e6ea to your computer and use it in GitHub Desktop.
How to configure cucumber in different folder at gradle application
public class ApplicationSpringBootstrapStep extends WebApplicationTests {
@Given("I bootstrap the spring application")
public void bootstrapApplication() {
}
}
configurations {
itestCompile.extendsFrom testCompile
itestRuntime.extendsFrom testRuntime
}
sourceSets {
itest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/itest/java')
}
resources.srcDir file('src/itest/resources')
}
}
task itest(type: Test) {
testClassesDir = sourceSets.itest.output.classesDir
classpath = sourceSets.itest.runtimeClasspath
testLogging {
events "passed", "skipped", "failed"
}
}
test.finalizedBy(itest)
@RunWith(Cucumber.class)
@CucumberOptions(format = "pretty", features = "src/itest/resources")
public class FeatureTestRunner {}
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = BrokerScheduleApplication.class, loader = SpringApplicationContextLoader.class)
@WebIntegrationTest(randomPort = true)
public class WebApplicationTest{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment