I am working on JGiven framework for my tests (already a big fan!). I have an issue though working with @DataProvider
I was going through the documentation http://jgiven.org/docs/parameterizedscenarios/ but I get the following error
java.lang.Exception: Method test_update_order should have no parameters
at org.junit.runners.model.FrameworkMethod.validatePublicVoidNoArg(FrameworkMethod.java:76)
at org.junit.runners.ParentRunner.validatePublicVoidNoArgMethods(ParentRunner.java:155)
at org.junit.runners.BlockJUnit4ClassRunner.validateTestMethods(BlockJUnit4ClassRunner.java:
208)
at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.j
ava:188)
at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunn
er.java:128)
at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
at org.junit.runners.ParentRunner.<init>(ParentRunner.java:84)
at org.junit.runners.BlockJUnit4ClassRunner.<init>(BlockJUnit4ClassRunner.java:65)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassR
unner.java:111)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm
pl.java:45)
My Test class is as follows
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes=Application.class)
@WebAppConfiguration
@IntegrationTest("server.port:0")
@Story( { "JIRA-123" } )
@Description("Story: coffee shop")
public class CoffeeShopTest extends ScenarioTest<GivenSomeState, WhenSomeAction, ThenSomeOutcome> {
@Test @Issue( { "OUI-1156"} )
@Description("Test for update order for coffee shop")
@DataProvider( {
"1",
"3",
"2",
} )
public void test_update_order(int coffee) {
given()
...
when()
...
then()
...;
}
}
Thank You!