Skip to content

Commit 34eb701

Browse files
committed
[Misc] Fix some Sonarqube-reported issues related to tests (make sure all test methods have an assert)
1 parent c27ce56 commit 34eb701

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

xwiki-commons-core/xwiki-commons-component/xwiki-commons-component-default/src/test/java/org/xwiki/component/embed/EmbeddableComponentManagerTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.xwiki.test.LogLevel;
5151
import org.xwiki.test.junit5.LogCaptureExtension;
5252

53+
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
5354
import static org.junit.jupiter.api.Assertions.assertEquals;
5455
import static org.junit.jupiter.api.Assertions.assertFalse;
5556
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -827,7 +828,7 @@ void dispose() throws Exception
827828
}
828829

829830
@Test
830-
void diposeWhenImplementationIsECM()
831+
void disposeWhenImplementationIsECM()
831832
{
832833
EmbeddableComponentManager ecm = new EmbeddableComponentManager();
833834

@@ -839,7 +840,7 @@ void diposeWhenImplementationIsECM()
839840
ecm.registerComponent(cd, ecm);
840841

841842
// If the test fails, the following line will generate a StackOverflowException
842-
ecm.dispose();
843+
assertDoesNotThrow(ecm::dispose);
843844
}
844845

845846
public static class ComponentDescriptorRoleImpl implements TestRole

0 commit comments

Comments
 (0)