@Operation(summary = "Get collect metadata process errors by connection metadata process result id")
    @GetMapping(value = "collect_metadata/errors/{result_id}", produces = "application/json")
    @ResponseBody
    public Page<SamlMetadataProcessError> findBySamlMetadataProcessResultId(@RequestParam(name = "page") int pageIndex,
                                                                            @RequestParam(name = "size") int pageSize, @PathVariable("result_id") Long resultId) {
        return metadataRetrieverService.getSamlMetadataById(resultId, pageIndex, pageSize);
    }
@Test
    public void findBySamlMetadataProcessResultId() {
        when(metadataRetrieverServiceMock.getSamlMetadataById(anyLong(), anyInt(), anyInt())).thenReturn(MetadataProcessHelper.getPageSamlMetadataProcessError());

        Page<SamlMetadataProcessError> result = controllerMock.findBySamlMetadataProcessResultId(1, 10, 1L);

        verify(metadataRetrieverServiceMock, times(1)).getSamlMetadataById(anyLong(), anyInt(), anyInt());
        assertNotNull(result);
    }