database-rider: Could not run parameterized with DBUnitRule with database rider > 1.2.9
Lookup for method annotations fails with parametrized tests in DBUnitRule.apply:
java.lang.RuntimeException: Could not find method shouldJustRunMoreThanOneTime[0] on test class ParameterizedTest
at com.github.database.rider.core.util.AnnotationUtils.findAnnotation(AnnotationUtils.java:179)
at com.github.database.rider.core.DBUnitRule.apply(DBUnitRule.java:57)
...
Running parameterized tests is fine with version 1.2.9 but fails with all later versions including 1.3.0 and 1.4.0
You may refer to this test case for verification:
@RunWith(Parameterized.class)
@DBUnit(url = "jdbc:h2:mem:test", driver = "org.h2.Driver", user = "u", password = "p")
public class ParameterizedTest {
private int given;
private int expected;
@Rule
public final DBUnitRule dbUnitRule = DBUnitRule.instance();
@Parameters
public static Collection<Object[]> data() {
return Arrays.asList(
new Object[] {0,0},
new Object[] {1,1},
new Object[] {2,2}
);
}
public ParameterizedTest(int given, int expected) {
this.given = given;
this.expected = expected;
}
@Test
public void shouldJustRunMoreThanOneTime() {
Assertions.assertThat(given).isEqualTo(expected);
}
}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (9 by maintainers)
Commits related to this issue
- refs #104 — committed to database-rider/database-rider by rmpestano 4 years ago
- refs #104 remove unused logger — committed to database-rider/database-rider by rmpestano 4 years ago
- refs #104 — committed to database-rider/database-rider by rmpestano 4 years ago
- refs #104 fix tests — committed to database-rider/database-rider by rmpestano 4 years ago
- fix(deps): WIP upgrade db rider https://github.com/database-rider/database-rider/issues/104 blocked us for a long time, but is now in active development. — committed to SDA-SE/sda-dropwizard-commons by JoergSiebahn 4 years ago
- fix(deps): WIP upgrade db rider https://github.com/database-rider/database-rider/issues/104 blocked us for a long time, but is now in active development. — committed to SDA-SE/sda-dropwizard-commons by JoergSiebahn 4 years ago
- refs #104 prevent npe in case of parameterized tests — committed to database-rider/database-rider by rmpestano 4 years ago
- fix(deps): upgrade db rider https://github.com/database-rider/database-rider/issues/104 blocked us for a long time, but is now closed. — committed to SDA-SE/sda-dropwizard-commons by JoergSiebahn 4 years ago
- fix(deps): upgrade db rider https://github.com/database-rider/database-rider/issues/104 blocked us for a long time, but is now closed. — committed to SDA-SE/sda-dropwizard-commons by JoergSiebahn 4 years ago
- fix(deps): upgrade db rider https://github.com/database-rider/database-rider/issues/104 blocked us for a long time, but is now closed. — committed to SDA-SE/sda-dropwizard-commons by JoergSiebahn 4 years ago
- fix(deps): upgrade db rider https://github.com/database-rider/database-rider/issues/104 blocked us for a long time, but is now closed. — committed to SDA-SE/sda-dropwizard-commons by JoergSiebahn 4 years ago
- fix(deps): upgrade db rider https://github.com/database-rider/database-rider/issues/104 blocked us for a long time, but is now closed. — committed to SDA-SE/sda-dropwizard-commons by JoergSiebahn 4 years ago
- refs #104 - adds quarkus parameterized test - updates quarkus version - comment outmultiple ds related code in quarkus sample — committed to database-rider/database-rider by rmpestano 3 years ago
- refs #104 - adds quarkus parameterized test - updates quarkus version - comment outmultiple ds related code in quarkus sample — committed to database-rider/database-rider by rmpestano 3 years ago
- refs #104 fixes assertion — committed to database-rider/database-rider by rmpestano 3 years ago
- refs #104 fixes assertion — committed to database-rider/database-rider by rmpestano 3 years ago
- refs #104 fixes assertion — committed to database-rider/database-rider by rmpestano 3 years ago
- refs #104 — committed to database-rider/database-rider by rmpestano 3 years ago
It seems to be working perfectly @rmpestano, great job, thank you!
Hi again @victor-costa-avancee, I couldn’t run your sample because of database setup so I tried to reproduce on quarkus dbunit sample which uses CDI but It’s working there, can you have a look? https://github.com/database-rider/database-rider/blob/1bd24f0c5aa659cebf91b045afd601d67bdb7140/rider-examples/quarkus-dbunit-sample/src/test/java/com/github/quarkus/sample/QuarkusDBUnitParameterizedTest.java#L32-L59
I hope It helps
Im using rider-cdi. Here is a reproducer https://github.com/victor-costa-avancee/DBRider-param-reproducer
Thank you very much. We integrated the latest version successfully.