mercredi 28 février 2018

Create test hierarchy with @TestFactory

I'm using the Junit 5 annotation @TestFactory to generate several tests like this :

@TestFactory
public Collection<DynamicTest> myTest() throws IOException {
    return fetchSomeTests().stream()
            .map(test -> {
                return dynamicTest(test.get("testDescription"), () -> doMyTest(test));
    }).collect(Collectors.toList());
}

Is it possible to organize generated tests in groups, just like when you use different classes of @Test ?

Aucun commentaire:

Enregistrer un commentaire