us.ihmc.commons.AssertionsTest Maven / Gradle / Ivy
package us.ihmc.commons;
import org.junit.jupiter.api.Test;
import org.opentest4j.AssertionFailedError;
public class AssertionsTest
{
@Test
public void testAssertExceptionThrown()
{
Assertions.assertExceptionThrown(Exception.class, new RunnableThatThrows()
{
@Override
public void run() throws Throwable
{
throw new Exception();
}
});
}
@Test
public void testAssertExceptionNotThrown()
{
Assertions.assertExceptionThrown(AssertionFailedError.class, new RunnableThatThrows()
{
@Override
public void run() throws Throwable
{
Assertions.assertExceptionThrown(IndexOutOfBoundsException.class, new RunnableThatThrows()
{
@Override
public void run() throws Throwable
{
throw new NullPointerException();
}
});
}
});
}
public static void main(String[] args)
{
MutationTestFacilitator.facilitateMutationTestForClass(Assertions.class, AssertionsTest.class);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy