From 215b1b67eb4cade7cc48649b81a899ceaf965a34 Mon Sep 17 00:00:00 2001 From: Chamber6821 Date: Thu, 18 Apr 2024 02:28:26 +0300 Subject: [PATCH] test(CriteriaSearchEmployee): search something --- .../search/CriteriaSearchEmployeeTest.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/test/java/com/example/jonebook/services/search/CriteriaSearchEmployeeTest.java diff --git a/src/test/java/com/example/jonebook/services/search/CriteriaSearchEmployeeTest.java b/src/test/java/com/example/jonebook/services/search/CriteriaSearchEmployeeTest.java new file mode 100644 index 0000000..8f89f9e --- /dev/null +++ b/src/test/java/com/example/jonebook/services/search/CriteriaSearchEmployeeTest.java @@ -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); + } +}