Package test.repository.user
Class UserRepositoryTest
java.lang.Object
test.repository.user.UserRepositoryTest
This class is used to test the faculty repository.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Test adding Supervisor intoFacultyRepository
.void
Test checking ifFacultyRepository
contains a Supervisor.private FacultyRepository
This method is used to create a faculty repository with 3 supervisors from the array.void
Test getting the list of Supervisors fromFacultyRepository
.void
Test getting a Supervisor fromFacultyRepository
.void
Test removing Supervisor fromFacultyRepository
.void
setUp()
This method is used to set up the supervisors.void
This method is used to clear the faculty repository before each test.void
Test getting the size ofFacultyRepository
.
-
Field Details
-
supervisors
The array of supervisors.
-
-
Constructor Details
-
UserRepositoryTest
public UserRepositoryTest()
-
-
Method Details
-
setUp
@BeforeAll public void setUp()This method is used to set up the supervisors. -
setUpEach
@BeforeEach public void setUpEach()This method is used to clear the faculty repository before each test. -
createFacultyList
This method is used to create a faculty repository with 3 supervisors from the array.- Returns:
- The faculty repository.
- Throws:
ModelAlreadyExistsException
- If the model already exists.
-
addUserTest
@Test @DisplayName("Test add user") public void addUserTest() throws ModelNotFoundException, ModelAlreadyExistsExceptionTest adding Supervisor intoFacultyRepository
.- Throws:
ModelNotFoundException
- If the model is not found.ModelAlreadyExistsException
- If the model already exists.
-
removeUserTest
@Test @DisplayName("Test remove user") public void removeUserTest() throws ModelNotFoundException, ModelAlreadyExistsExceptionTest removing Supervisor fromFacultyRepository
.- Throws:
ModelNotFoundException
- If the model is not found.ModelAlreadyExistsException
- If the model already exists.
-
containUserTest
@Test @DisplayName("Test contains user") public void containUserTest() throws ModelAlreadyExistsExceptionTest checking ifFacultyRepository
contains a Supervisor.- Throws:
ModelAlreadyExistsException
- If the model already exists when creating the repository.
-
getUserTest
@Test @DisplayName("Test get user") public void getUserTest() throws ModelNotFoundException, ModelAlreadyExistsExceptionTest getting a Supervisor fromFacultyRepository
.- Throws:
ModelNotFoundException
- If the model is not found.ModelAlreadyExistsException
- If the model already exists when creating the repository.
-
userSizeTest
@Test @DisplayName("Test user size") public void userSizeTest() throws ModelNotFoundException, ModelAlreadyExistsExceptionTest getting the size ofFacultyRepository
.- Throws:
ModelNotFoundException
- If the model is not found.ModelAlreadyExistsException
- If the model already exists when creating the repository.
-
findByRulesTest
@Test @DisplayName("Find By Rules Test") public void findByRulesTest() throws ModelAlreadyExistsExceptionTest getting the list of Supervisors fromFacultyRepository
.- Throws:
ModelAlreadyExistsException
- If the model already exists when creating the repository.
-