Package test.repository.user
Class UserRepositoryTest
java.lang.Object
test.repository.user.UserRepositoryTest
This class is used to test the faculty repository.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTest adding Supervisor intoFacultyRepository.voidTest checking ifFacultyRepositorycontains a Supervisor.private FacultyRepositoryThis method is used to create a faculty repository with 3 supervisors from the array.voidTest getting the list of Supervisors fromFacultyRepository.voidTest getting a Supervisor fromFacultyRepository.voidTest removing Supervisor fromFacultyRepository.voidsetUp()This method is used to set up the supervisors.voidThis method is used to clear the faculty repository before each test.voidTest 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 ifFacultyRepositorycontains 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.
-