mardi 30 janvier 2018

Failing Maven test JUnit5 test programmatically

I do execute my Maven tests with JUnit5, where all the test classes have the

@ExtendWith({ProcessExtension.class})

annotation. This extension must fail test methods according to a special logic in the if it is the case. But I have no idea how.

The method

@Override
public void afterEach(ExtensionContext context) {
    ...
}

gets this context parameter but the is no way to fail the already executed test method. How could I notify the Maven that the method has failed?

KI

Aucun commentaire:

Enregistrer un commentaire