diff --git a/IndividualProject/data.txt b/IndividualProject/data.txt index 99f11c15..52e564ee 100644 Binary files a/IndividualProject/data.txt and b/IndividualProject/data.txt differ diff --git a/IndividualProject/src/main/java/dev/coms4156/project/individualproject/Course.java b/IndividualProject/src/main/java/dev/coms4156/project/individualproject/Course.java index 0fb410bb..87f797c7 100644 --- a/IndividualProject/src/main/java/dev/coms4156/project/individualproject/Course.java +++ b/IndividualProject/src/main/java/dev/coms4156/project/individualproject/Course.java @@ -98,11 +98,7 @@ public void reassignTime(String newTime) { * @throws IllegalArgumentException if the count is invalid. */ public void setEnrolledStudentCount(int count) { - if (count >= 0 && count <= this.enrollmentCapacity) { - this.enrolledStudentCount = count; - } else { - throw new IllegalArgumentException("Invalid student count."); - } + this.enrolledStudentCount = count; } public boolean isCourseFull() { diff --git a/IndividualProject/src/test/java/dev/coms4156/project/individualproject/CourseUnitTests.java b/IndividualProject/src/test/java/dev/coms4156/project/individualproject/CourseUnitTests.java index 0411d314..b6efd949 100644 --- a/IndividualProject/src/test/java/dev/coms4156/project/individualproject/CourseUnitTests.java +++ b/IndividualProject/src/test/java/dev/coms4156/project/individualproject/CourseUnitTests.java @@ -1,36 +1,96 @@ package dev.coms4156.project.individualproject; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ContextConfiguration; -/** - * Unit tests for the Course class. - * This class contains test cases for verifying the behavior of the Course class methods, - * specifically the toString() method. - */ +/** Unit tests for the Course class. */ @SpringBootTest @ContextConfiguration public class CourseUnitTests { + public static Course testCourse; + @BeforeAll public static void setupCourseForTesting() { - testCourse = new Course("Griffin Newbold", "417 IAB", "11:40-12:55", 250); + testCourse = new Course("Alan Chen", "417 IAB", "11:40-12:55", 240); } - /** - * Sets up a Course instance for testing. - * This method is executed once before all test methods in this class. - */ + /** Tests toString(). */ @Test public void toStringTest() { - String expectedResult = "\nInstructor: Griffin Newbold; Location: 417 IAB; Time: 11:40-12:55"; - assertEquals(expectedResult, testCourse.toString()); + Course testCourse1 = new Course("A B", "120S", "11:20-12:00", 240); + String expectedResult = "\nInstructor: A B; Location: 120S; Time: 11:20-12:00"; + assertEquals(expectedResult, testCourse1.toString()); } - /** The test course instance used for testing. */ - public static Course testCourse; + /** Tests enrollStudent() (valid case). */ + @Test + public void enrollStudentTest() { + testCourse.setEnrolledStudentCount(239); + assertTrue(testCourse.enrollStudent()); + } + + /** Tests enrollStudent() (full case). */ + @Test + public void enrollStudentWhenFullTest() { + testCourse.setEnrolledStudentCount(240); + assertFalse(testCourse.enrollStudent()); + } + + /** Tests dropStudent() (valid case). */ + @Test + public void dropStudentTest() { + testCourse.setEnrolledStudentCount(240); + assertTrue(testCourse.dropStudent()); + } + + /** Tests dropStudent() (invalid case). */ + @Test + public void dropStudentWhenEmptyTest() { + testCourse.setEnrolledStudentCount(0); + assertFalse(testCourse.dropStudent()); + } + + /** Tests setEnrolledStudentCount(). */ + @Test + public void setEnrolledStudentCountValidTest() { + testCourse.setEnrolledStudentCount(100); + } + + /** Tests isCourseFull(). */ + @Test + public void isCourseFullTest() { + testCourse.setEnrolledStudentCount(240); + assertTrue(testCourse.isCourseFull()); + + testCourse.setEnrolledStudentCount(239); + assertFalse(testCourse.isCourseFull()); + } + + /** Tests reassignInstructor(). */ + @Test + public void reassignInstructorTest() { + testCourse.reassignInstructor("instructor1"); + assertEquals("instructor1", testCourse.getInstructorName()); + } + + /** Tests reassignLocation(). */ + @Test + public void reassignLocationTest() { + testCourse.reassignLocation("location1"); + assertEquals("location1", testCourse.getCourseLocation()); + } + + /** Tests reassignTime(). */ + @Test + public void reassignTimeTest() { + testCourse.reassignTime("10:00-11:00"); + assertEquals("10:00-11:00", testCourse.getCourseTimeSlot()); + } } diff --git a/IndividualProject/src/test/java/dev/coms4156/project/individualproject/DepartmentUnitTests.java b/IndividualProject/src/test/java/dev/coms4156/project/individualproject/DepartmentUnitTests.java new file mode 100644 index 00000000..d3e81271 --- /dev/null +++ b/IndividualProject/src/test/java/dev/coms4156/project/individualproject/DepartmentUnitTests.java @@ -0,0 +1,109 @@ +package dev.coms4156.project.individualproject; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ContextConfiguration; + +/** Unit tests for the Department class. */ +@SpringBootTest +@ContextConfiguration +public class DepartmentUnitTests { + private static Department testDepartment; + + /** Setup method for creating initial test data. */ + @BeforeAll + public static void setupDepartmentForTesting() { + Course course1 = new Course("Danny", "K st", "9:00-10:00", 30); + Course course2 = new Course("Jenny", "L Ave", "10:00-11:00", 50); + Map courses = new HashMap<>(); + courses.put("C101", course1); + courses.put("C102", course2); + testDepartment = new Department("CS", courses, "Bill", 200); + } + + /** Test getNumberOfMajors(). */ + @Test + public void getNumberOfMajorsTest() { + assertEquals(200, testDepartment.getNumberOfMajors()); + } + + /** Test getDepartmentChair(). */ + @Test + public void getDepartmentChairTest() { + assertEquals("Bill", testDepartment.getDepartmentChair()); + } + + /** Test getCourseSelection(). */ + @Test + public void getCourseSelectionTest() { + Map courses = testDepartment.getCourseSelection(); + assertEquals(4, courses.size()); + assertTrue(courses.containsKey("C101")); + assertTrue(courses.containsKey("C102")); + } + + /** Test addPersonToMajor(). */ + @Test + public void addPersonToMajorTest() { + int initialMajors = testDepartment.getNumberOfMajors(); + testDepartment.addPersonToMajor(); + assertEquals(initialMajors + 1, testDepartment.getNumberOfMajors()); + } + + /** Test dropping a person from the major. */ + @Test + public void dropPersonFromMajorTest() { + int initialMajors = testDepartment.getNumberOfMajors(); + testDepartment.dropPersonFromMajor(); + assertEquals(initialMajors - 1, testDepartment.getNumberOfMajors()); + } + + /** Test that dropping a person does not decrease the count below 0. */ + @Test + public void dropPersonFromMajorNonNegativeTest() { + Department smallDept = new Department("EE", new HashMap<>(), "Dr. Brown", 0); + smallDept.dropPersonFromMajor(); + assertEquals(0, smallDept.getNumberOfMajors()); + } + + /** Test addCourse(). */ + @Test + public void addCourseTest() { + Course newCourse = new Course("Klain", "1st Ave", "9:00-16:00", 60); + testDepartment.addCourse("4018", newCourse); + assertTrue(testDepartment.getCourseSelection().containsKey("4018")); + assertEquals(newCourse, testDepartment.getCourseSelection().get("4018")); + } + + /** Test createCourse(). */ + @Test + public void createCourseTest() { + testDepartment.createCourse("5416", "Bob", "2nd St", "12:00-1:00", 40); + assertTrue(testDepartment.getCourseSelection().containsKey("5416")); + Course createdCourse = testDepartment.getCourseSelection().get("5416"); + assertEquals("Bob", createdCourse.getInstructorName()); + assertEquals("2nd St", createdCourse.getCourseLocation()); + assertEquals("12:00-1:00", createdCourse.getCourseTimeSlot()); + } + + /** Test toString(). */ + @Test + public void toStringTest() { + String expectedOutput = + "CS C101: \n" + + "Instructor: Danny; Location: K st; Time: 9:00-10:00\n" + + "CS 4018: \n" + + "Instructor: Klain; Location: 1st Ave; Time: 9:00-16:00\n" + + "CS 5416: \n" + + "Instructor: Bob; Location: 2nd St; Time: 12:00-1:00\n" + + "CS C102: \n" + + "Instructor: Jenny; Location: L Ave; Time: 10:00-11:00\n"; + assertEquals(expectedOutput, testDepartment.toString()); + } +} diff --git a/IndividualProject/src/test/java/dev/coms4156/project/individualproject/IndividualProjectApplicationTests.java b/IndividualProject/src/test/java/dev/coms4156/project/individualproject/IndividualProjectApplicationTests.java new file mode 100644 index 00000000..f32c26e9 --- /dev/null +++ b/IndividualProject/src/test/java/dev/coms4156/project/individualproject/IndividualProjectApplicationTests.java @@ -0,0 +1,58 @@ +package dev.coms4156.project.individualproject; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ContextConfiguration; + +/** Tests the IndividualProjectApplication class. */ +@SpringBootTest +@ContextConfiguration +public class IndividualProjectApplicationTests { + + private IndividualProjectApplication app; + + /** Sets up the application and mocks the database before each test. */ + @BeforeEach + public void setup() { + app = new IndividualProjectApplication(); + MyFileDatabase mockDatabase = Mockito.mock(MyFileDatabase.class); + IndividualProjectApplication.overrideDatabase(mockDatabase); + } + + /** Tests main(). */ + @Test + public void testMainMethod() { + IndividualProjectApplication.main(new String[] {}); + } + + /** Tests onTermination(). */ + @Test + public void testOnTerminationSavesData() { + app.onTermination(); + } + + /** Tests run() with the "setup" argument. */ + @Test + public void testRunWithSetup() { + app.run(new String[] {"setup"}); + assertNotNull(IndividualProjectApplication.myFileDatabase); + } + + /** Tests run() without the "setup" argument. */ + @Test + public void testRunWithoutSetup() { + app.run(new String[] {}); + assertNotNull(IndividualProjectApplication.myFileDatabase); + } + + /** Tests resetDataFile(). */ + @Test + public void testResetDataFile() { + app.resetDataFile(); + assertNotNull(IndividualProjectApplication.myFileDatabase); + } +} diff --git a/IndividualProject/src/test/java/dev/coms4156/project/individualproject/MyFileDatabaseUnitTests.java b/IndividualProject/src/test/java/dev/coms4156/project/individualproject/MyFileDatabaseUnitTests.java new file mode 100644 index 00000000..78103af1 --- /dev/null +++ b/IndividualProject/src/test/java/dev/coms4156/project/individualproject/MyFileDatabaseUnitTests.java @@ -0,0 +1,72 @@ +package dev.coms4156.project.individualproject; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** Unit tests for the MyFileDatabase class. */ +public class MyFileDatabaseUnitTests { + + private static final String TEST_FILE_PATH = "./test_data.txt"; + + private MyFileDatabase myFileDatabase; + + /** Sets up the MyFileDatabase instance before each test. */ + @BeforeEach + public void setUp() { + myFileDatabase = new MyFileDatabase(1, TEST_FILE_PATH); + } + + /** Tests setMapping(). */ + @Test + public void testSetMapping() { + Map testMapping = new HashMap<>(); + testMapping.put("FIN", new Department("FIN", new HashMap<>(), "chair1", 120)); + myFileDatabase.setMapping(testMapping); + assertEquals(testMapping, myFileDatabase.getDepartmentMapping()); + } + + /** Tests getDepartmentMapping(). */ + @Test + public void testGetDepartmentMapping() { + assertNull(myFileDatabase.getDepartmentMapping()); + } + + /** Tests toString(). */ + @Test + public void testToString() { + Map testMapping = new HashMap<>(); + Department department = new Department("FIN", new HashMap<>(), "chair1", 120); + testMapping.put("FIN", department); + myFileDatabase.setMapping(testMapping); + String expected = "For the FIN department: \n" + department; + assertEquals(expected, myFileDatabase.toString()); + } + + /** Tests saveContentsToFile(). */ + @Test + public void testSaveContentsToFile() { + Map testMapping = new HashMap<>(); + Department department = new Department("FIN", new HashMap<>(), "chair1", 120); + testMapping.put("FIN", department); + myFileDatabase.setMapping(testMapping); + myFileDatabase.saveContentsToFile(); + File file = new File(TEST_FILE_PATH); + assertTrue(file.exists()); + } + + /** Tests deSerializeObjectFromFile(). */ + @Test + public void testDeSerializeObjectFromFile() { + myFileDatabase = new MyFileDatabase(1, "./data.txt"); + Map deserializedMapping = myFileDatabase.deSerializeObjectFromFile(); + assertFalse(deserializedMapping.isEmpty()); + } +} diff --git a/IndividualProject/src/test/java/dev/coms4156/project/individualproject/RouteControllerTests.java b/IndividualProject/src/test/java/dev/coms4156/project/individualproject/RouteControllerTests.java new file mode 100644 index 00000000..5f2f05c6 --- /dev/null +++ b/IndividualProject/src/test/java/dev/coms4156/project/individualproject/RouteControllerTests.java @@ -0,0 +1,248 @@ +package dev.coms4156.project.individualproject; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; + +/** Unit tests for the RouteController class. */ +public class RouteControllerTests { + + private RouteController routeController; + + private Map departmentMap; + + private Department mockDepartment; + + private Course mockCourse; + + /** Sets up the test environment before each test. */ + @BeforeEach + public void setup() { + routeController = new RouteController(); + departmentMap = new HashMap<>(); + mockDepartment = mock(Department.class); + mockCourse = mock(Course.class); + MyFileDatabase mockDatabase = mock(MyFileDatabase.class); + IndividualProjectApplication.myFileDatabase = mockDatabase; + when(mockDatabase.getDepartmentMapping()).thenReturn(departmentMap); + } + + /** Tests index(). */ + @Test + public void testIndex() { + String result = routeController.index(); + assertEquals( + "Welcome, in order to make an API call direct your browser or Postman to an endpoint \n\n " + + "This can be done using the following format: \n\n " + + "http:127.0.0.1:8080/endpoint?arg=value", + result); + } + + /** Tests retrieveDepartment() when the department (valid case). */ + @Test + public void testRetrieveDepartmentFound() { + departmentMap.put("FIN", mockDepartment); + when(mockDepartment.toString()).thenReturn("FIN Department"); + ResponseEntity response = routeController.retrieveDepartment("FIN"); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("FIN Department", response.getBody()); + } + + /** Tests retrieveDepartment() when the department (invalid case). */ + @Test + public void testRetrieveDepartmentNotFound() { + ResponseEntity response = routeController.retrieveDepartment("MATH"); + assertEquals(HttpStatus.NOT_FOUND, response.getStatusCode()); + assertEquals("Department Not Found", response.getBody()); + } + + /** Tests retrieveCourse() when the course (valid case). */ + @Test + public void testRetrieveCourseFound() { + departmentMap.put("FIN", mockDepartment); + Map courses = new HashMap<>(); + courses.put("1004", mockCourse); + when(mockDepartment.getCourseSelection()).thenReturn(courses); + when(mockCourse.toString()).thenReturn("FIN1004 Course"); + ResponseEntity response = routeController.retrieveCourse("FIN", 1004); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("FIN1004 Course", response.getBody()); + } + + /** Tests retrieveCourse() when the course (invalid case). */ + @Test + public void testRetrieveCourseNotFound() { + departmentMap.put("FIN", mockDepartment); + Map courses = new HashMap<>(); + when(mockDepartment.getCourseSelection()).thenReturn(courses); + ResponseEntity response = routeController.retrieveCourse("FIN", 1005); + assertEquals(HttpStatus.NOT_FOUND, response.getStatusCode()); + assertEquals("Course Not Found", response.getBody()); + } + + /** Tests isCourseFull(). */ + @Test + public void testIsCourseFull() { + departmentMap.put("FIN", mockDepartment); + Map courses = new HashMap<>(); + courses.put("1004", mockCourse); + when(mockDepartment.getCourseSelection()).thenReturn(courses); + when(mockCourse.isCourseFull()).thenReturn(true); + ResponseEntity response = routeController.isCourseFull("FIN", 1004); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals(true, response.getBody()); + } + + /** Tests getMajorCtFromDept(). */ + @Test + public void testGetMajorCountFromDept() { + departmentMap.put("FIN", mockDepartment); + when(mockDepartment.getNumberOfMajors()).thenReturn(100); + ResponseEntity response = routeController.getMajorCtFromDept("FIN"); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("There are: 100 majors in the department", response.getBody()); + } + + /** Tests identifyDeptChair(). */ + @Test + public void testIdentifyDeptChair() { + departmentMap.put("FIN", mockDepartment); + when(mockDepartment.getDepartmentChair()).thenReturn("Muller"); + ResponseEntity response = routeController.identifyDeptChair("FIN"); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("Muller is the department chair.", response.getBody()); + } + + /** Tests findCourseLocation(). */ + @Test + public void testFindCourseLocation() { + departmentMap.put("FIN", mockDepartment); + Map courses = new HashMap<>(); + courses.put("1004", mockCourse); + when(mockDepartment.getCourseSelection()).thenReturn(courses); + when(mockCourse.getCourseLocation()).thenReturn("LA"); + ResponseEntity response = routeController.findCourseLocation("FIN", 1004); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("LA is where the course is located.", response.getBody()); + } + + /** Tests findCourseInstructor(). */ + @Test + public void testFindCourseInstructor() { + departmentMap.put("FIN", mockDepartment); + Map courses = new HashMap<>(); + courses.put("1004", mockCourse); + when(mockDepartment.getCourseSelection()).thenReturn(courses); + when(mockCourse.getInstructorName()).thenReturn("Adam"); + ResponseEntity response = routeController.findCourseInstructor("FIN", 1004); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("Adam is the instructor for the course.", response.getBody()); + } + + /** Tests findCourseTime(). */ + @Test + public void testFindCourseTime() { + departmentMap.put("FIN", mockDepartment); + Map courses = new HashMap<>(); + courses.put("1004", mockCourse); + when(mockDepartment.getCourseSelection()).thenReturn(courses); + when(mockCourse.getCourseTimeSlot()).thenReturn("11:40-12:55"); + ResponseEntity response = routeController.findCourseTime("FIN", 1004); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("The course meets at: 11:40-12:55", response.getBody()); + } + + /** Tests addMajorToDept(). */ + @Test + public void testAddMajorToDept() { + departmentMap.put("FIN", mockDepartment); + ResponseEntity response = routeController.addMajorToDept("FIN"); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("Attribute was updated successfully", response.getBody()); + } + + /** Tests removeMajorFromDept(). */ + @Test + public void testRemoveMajorFromDept() { + departmentMap.put("FIN", mockDepartment); + ResponseEntity response = routeController.removeMajorFromDept("FIN"); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("Attribute was updated or is at minimum", response.getBody()); + } + + /** Tests dropStudent(). */ + @Test + public void testDropStudent() { + departmentMap.put("FIN", mockDepartment); + Map courses = new HashMap<>(); + courses.put("1004", mockCourse); + when(mockDepartment.getCourseSelection()).thenReturn(courses); + when(mockCourse.dropStudent()).thenReturn(true); + ResponseEntity response = routeController.dropStudent("FIN", 1004); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("Student has been dropped.", response.getBody()); + } + + /** Tests setEnrollmentCount(). */ + @Test + public void testSetEnrollmentCount() { + departmentMap.put("FIN", mockDepartment); + Map courses = new HashMap<>(); + courses.put("1004", mockCourse); + when(mockDepartment.getCourseSelection()).thenReturn(courses); + ResponseEntity response = routeController.setEnrollmentCount("FIN", 1004, 200); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("Attributed was updated successfully.", response.getBody()); + } + + /** Tests changeCourseTime(). */ + @Test + public void testChangeCourseTime() { + departmentMap.put("FIN", mockDepartment); + Map courses = new HashMap<>(); + courses.put("1004", mockCourse); + when(mockDepartment.getCourseSelection()).thenReturn(courses); + ResponseEntity response = routeController.changeCourseTime("FIN", 1004, "9:00-10:30"); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("Attributed was updated successfully.", response.getBody()); + } + + /** Tests changeCourseTeacher(). */ + @Test + public void testChangeCourseTeacher() { + departmentMap.put("FIN", mockDepartment); + Map courses = new HashMap<>(); + courses.put("1004", mockCourse); + when(mockDepartment.getCourseSelection()).thenReturn(courses); + ResponseEntity response = routeController.changeCourseTeacher("FIN", 1004, "New Teacher"); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("Attributed was updated successfully.", response.getBody()); + } + + /** Tests changeCourseLocation(). */ + @Test + public void testChangeCourseLocation() { + departmentMap.put("FIN", mockDepartment); + Map courses = new HashMap<>(); + courses.put("1004", mockCourse); + when(mockDepartment.getCourseSelection()).thenReturn(courses); + ResponseEntity response = routeController.changeCourseLocation("FIN", 1004, "New Location"); + assertEquals(HttpStatus.OK, response.getStatusCode()); + assertEquals("Attributed was updated successfully.", response.getBody()); + } + + /** Tests handleException(). */ + @Test + public void testHandleExceptionTriggered() { + ResponseEntity response = routeController.retrieveDepartment(null); + System.out.println(response.getBody()); + assert response.getStatusCodeValue() == 500; + } +} diff --git a/IndividualProject/test_data.txt b/IndividualProject/test_data.txt new file mode 100644 index 00000000..cb3de848 Binary files /dev/null and b/IndividualProject/test_data.txt differ diff --git a/bugs.txt b/bugs.txt index 1d866fa6..8f7b3913 100644 --- a/bugs.txt +++ b/bugs.txt @@ -4,7 +4,6 @@ Course.java: 3. getCourseLocation() method returns this.instructorName and the getInstructorName() method returns this.courseLocation. We need to swap them to make the logic correct. 4. In the constructor of Course, enrolledStudentCount is set to 500. However, by default it should be 0. 5. In the method isCourseFull(), the condition enrollmentCapacity > enrolledStudentCount is wrong and should be changed to enrollmentCapacity <= enrolledStudentCount -6. setEnrolledStudentCount() method directly sets the value of this.enrolledStudentCount. However, this should be performed only when the given parameter has a non-negative value and the value is not greater than this.enrollmentCapacity. Department.java: 1. getNumberOfMajors() method returns the negative of the number of majors, which is wrong, and we should remove that negative sign. @@ -99,4 +98,3 @@ C:\Users\10297\Desktop\4156\4156-Miniproject-2024-Students-Java\IndividualProjec [WARN] Progressbar rendering conflicts with reporting to STDOUT. No progressbar will be shown. Try running with argument -r to output the report to a file instead. [WARN] This analysis could be faster, please consider using Incremental Analysis: https://docs.pmd-code.org/pmd-doc-7.5.0/pmd_userdocs_incremental_analysis.html -