@Operation(summary = "Get all certificates based on conditions")
    @PostMapping(value = "/search", consumes = "application/json")
    @ResponseBody
    public Page<Certificate> search(@RequestBody CertSearchRequest request,
                                    @RequestParam(name = "page", defaultValue = "0") int pageIndex,
                                    @RequestParam(name = "size", defaultValue = "30") int pageSize) {
        return certificateService.searchAll(request, pageIndex, pageSize);
    }
@Test
    public void getAllCertificatesBasedOnConditions() {
        CertSearchRequest request = new CertSearchRequest();
        when(certificateServiceMock.searchAll(request, 1, 10)).thenReturn(getPageCertificates());

        Page<Certificate> result = controllerMock.search(request, 1, 10);

        verify(certificateServiceMock, times(1)).searchAll(any(CertSearchRequest.class), anyInt(), anyInt());
        assertNotNull(result);
        assertEquals(1, result.getTotalPages());
        assertEquals(2, result.getContent().size());
    }