Create Unit tests with JUnit and Maven in VSC

Опубликовано: 25 Ноябрь 2024
на канале: Cottrell Coding
4,937
31

In this video, I use JUnit 4 to create a series of unit tests for a simple Java class. I start with a default Java Maven project with a class in the src folder. I generate a new test file. The basic steps of creating a test are illustrated.

In this file, I demonstrate the @BeforeClass, @Ignore, and @Test annotations. I create three tests using assertEquals(string, expected, value). I create one test usingassertEquals(string, expected, value, delta). I then demonstrate the delta working.

I spend some time discussing the role of QA in the workplace. Your role as QA may be to just find the error or find and correct the error. Both are common. In either case