All Downloads are FREE. Search and download functionalities are using the official Maven repository.

us.ihmc.commons.AssertionsTest Maven / Gradle / Ivy

There is a newer version: 0.35.0
Show newest version
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