@Transactional
    public Map<String, String> collectSamlMetadata(String id) throws CollectSamlMetadataException {
        Map<String, String> map = new HashMap<>();
        List<Connection> list;
        LOGGER.info("Start collecting metadata!!");
        digidXClient.remoteLog("1446", null);

        try {
            list = id.equals("all") ? connectionService.listWithAllConnections() : connectionService.listWithOneConnection(Long.valueOf(id));
            for (Connection con : list) startCollectMetadata(con, map);
            map.put("count", String.valueOf(list.size()));
        } catch (Exception e) {
            LOGGER.error("An error has occurred collecting metadata connections: {}", e.getMessage());
            throw new CollectSamlMetadataException(e.getMessage());
        }
        digidXClient.remoteLog("1447", map);
        return map;
    }
@Test
    public void startCollectMetadataSignatureTest() throws CollectSamlMetadataException {
        metadataProcessorServiceMock.collectSamlMetadata("all");

        verify(digidXClientMock, times(1)).remoteLog(anyString(), anyMap());
    }