// Inheritance Project // employeehierarchy Module // Source code file: Test2.java // Unit test file. import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; public class Test2 { private Person p; private Employee emp; private Executive exec; @BeforeEach private void setUp() { p = new Person( "Alice", 'F', 21); emp = new Employee( "Bob", 'M', 35, 1234, 85000.00); exec = new Executive( "Rita", 'F', 46, 5678, 2500000,120000); } @Test public void testToString1() { assertEquals("Alice F 21", p.toString( )); } @Test public void testToString2() { assertEquals("Bob M 35 1234 85000.0", emp.toString( )); } @Test public void testGetCompensation1( ) { assertEquals(85000.0, emp.getCompensation( )); } @Test public void testToString3() { assertEquals("Rita F 46 5678 2500000.0 120000.0", exec.toString( )); } @Test public void testGetCompensation2( ) { assertEquals(2620000.0, exec.getCompensation()); } }