Fix: Ensure that resources like this SoftAssertions object are closed after use.
@@ -77,7 +77,7 @@ class QtTranslationParserTest extends AbstractParserTest {
Report report = parse(relativeFileName);
String fileName = new FileReaderFactory(getResourceAsFile(relativeFileName)).getFileName();
- SoftAssertions softly = new SoftAssertions();
+ try (SoftAssertions softly = new SoftAssertions()) {
softly.assertThat(report).hasSize(4);
softly.assertThat(report.get(0))
@@ -120,6 +120,7 @@ class QtTranslationParserTest extends AbstractParserTest {
.hasFileName(fileName)
.hasCategory(QtTranslationSaxParser.TRANSLATION_TYPE_UNFINISHED);
}
+ }
@Test
void duplicatedName() {
@@ -169,8 +170,8 @@ class QtTranslationParserTest extends AbstractParserTest {
Report report = parse(relativeFileName);
String fileName = getResourceAsFile(relativeFileName).toString();
- SoftAssertions softly = new SoftAssertions();
- softly.assertThat(report).hasSize(4);
+ try (SoftAssertions softly = new SoftAssertions()) {
+ softly.assertThat(report).hasSize(1);
softly.assertThat(report.get(0))
.hasSeverity(Severity.WARNING_NORMAL)
@@ -182,6 +183,7 @@ class QtTranslationParserTest extends AbstractParserTest {
.hasFileName(fileName)
.hasCategory(QtTranslationSaxParser.TRANSLATION_TYPE_OBSOLETE);
}
+ }
@Test
void rootElementHasParent() {
