-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(CriteriaSearchEmployee): search something
- Loading branch information
1 parent
44cffed
commit 215b1b6
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/test/java/com/example/jonebook/services/search/CriteriaSearchEmployeeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.example.jonebook.services.search; | ||
|
||
import static org.mockito.Mockito.*; | ||
|
||
import com.example.jonebook.repositories.EmployeeRepository; | ||
import com.example.jonebook.services.dto.EmployeeCriteria; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class CriteriaSearchEmployeeTest { | ||
@Test | ||
void searchAll() { | ||
new CriteriaSearchEmployee(mock(EmployeeRepository.class)) | ||
.search(EmployeeCriteria.builder() | ||
.nameFragment("Petr") | ||
.emailFragment("@") | ||
.phonePrefix("123") | ||
.internalPhonePrefix("321") | ||
.departmentVariants(new HashSet<>() { | ||
{ | ||
add("School"); | ||
} | ||
}) | ||
.postsFragment(new HashSet<>() { | ||
{ | ||
add("Teacher"); | ||
} | ||
}) | ||
.build(), | ||
null); | ||
} | ||
} |