package com.Nisum.JUnitIntro; import org.junit.jupiter.api.Test; import org.junit.Assert; //import org.junit.Test; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.springframework.boot.test.context.SpringBootTest; import static org.junit.jupiter.api.Assertions.*; class JUnitIntroApplicationTest { @BeforeEach void setUp() { System.out.println("Here's the setup for testing."); } @AfterEach void tearDown() { System.out.println("Here's the end of testing."); } @Test void add() { JUnitIntroApplication calculator = new JUnitIntroApplication(); int result = calculator.add(3, 4); int expected = 7; Assert.assertTrue("Adding failed", result == expected); } @Test void mult() { JUnitIntroApplication calculator = new JUnitIntroApplication(); double result = calculator.mult(9, 3); double expected = 27; Assert.assertTrue("Dividing failed", result == expected); } }