Junit Flashcards
What is JUnit
JUnit is a popular open-source testing framework for Java. It provides a platform to write and run repeatable tests, making it easier to automate and validate Java code. JUnit supports annotations to define test methods, setup and teardown methods, and assertions to verify expected outcomes, helping developers ensure the correctness of their code through automated testing.
What JUnit annotations do you know?
@Test, @Before, @After, @BeforeClass, @AfterClass, @Ignore.
What JUnit assert methods do you use?
Assert.assertTrue, Assert.assertFalse,
Assert.assertEquals
Assert.assertNotEquals,
Assert.Null.
How do you skip a test in JUnit?
You can skip a test in JUnit by using the @Ignore annotation