Package org.jenkinsci.plugins.ghprb.GhprbTrigger

Examples of org.jenkinsci.plugins.ghprb.GhprbTrigger.DescriptorImpl


    pulls.put(pullId, pullRequest);
    Map<String, ConcurrentMap<Integer, GhprbPullRequest>> jobs = new HashMap<String, ConcurrentMap<Integer, GhprbPullRequest>>(1);
    jobs.put("project", pulls);

    GithubProjectProperty projectProperty = new GithubProjectProperty("https://github.com/jenkinsci/ghprb-plugin");
    DescriptorImpl descriptor = trigger.getDescriptor();
   
    PrintStream logger = mock(PrintStream.class);

       
    given(project.getTrigger(GhprbTrigger.class)).willReturn(trigger);
    given(project.getName()).willReturn("project");
    given(project.getProperty(GithubProjectProperty.class)).willReturn(projectProperty);
   
    given(build.getCause(GhprbCause.class)).willReturn(cause);
    given(build.getResult()).willReturn(Result.SUCCESS);
    given(build.getParent()).willCallRealMethod();
   
    given(pullRequest.getPullRequest()).willReturn(pr);
   
       
        given(cause.getPullID()).willReturn(pullId);
        given(cause.isMerged()).willReturn(true);
        given(cause.getTriggerSender()).willReturn(triggerSender);
        given(cause.getCommitAuthor()).willReturn(committer);
       
       
        given(listener.getLogger()).willReturn(logger);
       
       
        doNothing().when(repo).addComment(anyInt(), anyString());
        doNothing().when(logger).println();
   

    Field parentField = Run.class.getDeclaredField("project");
    parentField.setAccessible(true);
    parentField.set(build, project);
   
   
   
    Field jobsField = descriptor.getClass().getDeclaredField("jobs");
    jobsField.setAccessible(true);
    jobsField.set(descriptor, jobs);
   

        helper = spy(new Ghprb(project, trigger, pulls));
View Full Code Here

TOP

Related Classes of org.jenkinsci.plugins.ghprb.GhprbTrigger.DescriptorImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.