Clean up assertions in CleanMojoTest by elharo · Pull Request #61 · apache/maven-clean-plugin

@elharo

@elharo

@elharo elharo marked this pull request as ready for review

November 14, 2024 05:35

gnodet

fail("Should fail to delete a file that is locked");
} catch (MojoException expected) {
assertTrue(true);
assertNotNull(expected.getMessage());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong too. The test should use assertThrows instead.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if I'd call it wrong. It's simply an older style of testing these things.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, converted to assertThrows

@elharo

gnodet