public PullRequestFilesProducer(GitHubEndpoint endpoint) throws Exception {
        super(endpoint);

        Registry registry = endpoint.getCamelContext().getRegistry();
        Object service = registry.lookupByName(GitHubConstants.GITHUB_PULL_REQUEST_SERVICE);
        if (service != null) {
            LOG.debug("Using PullRequestService found in registry {}", service.getClass().getCanonicalName());
            pullRequestService = (PullRequestService) service;
        } else {
            pullRequestService = new PullRequestService();
        }
        initService(pullRequestService);
    }
@Test
    public void testPullRequestFilesProducer() {
        PullRequest pullRequest = pullRequestService.addPullRequest("testPullRequestFilesProducer");
        latestPullRequestNumber = pullRequest.getNumber();

        CommitFile file = new CommitFile();
        file.setFilename("testfile");

        List<CommitFile> commitFiles = new ArrayList<>();
        commitFiles.add(file);
        pullRequestService.setFiles(latestPullRequestNumber, commitFiles);

        Endpoint filesProducerEndpoint = getMandatoryEndpoint("direct:validPullRequest");
        Exchange exchange = filesProducerEndpoint.createExchange();

        Exchange resp = template.send(filesProducerEndpoint, exchange);

        assertEquals(resp.getMessage().getBody(), commitFiles);
    }