@@ -0,0 +1,1591 @@
+package org.jenkinsci.plugins.ghprb.manager.factory;%0A%0Aimport static org.fest.assertions.Assertions.assertThat;%0A%0Aimport com.cloudbees.plugins.flow.BuildFlow;%0Aimport com.cloudbees.plugins.flow.FlowRun;%0A%0Aimport hudson.matrix.MatrixBuild;%0Aimport hudson.matrix.MatrixProject;%0A%0Aimport org.jenkinsci.plugins.ghprb.manager.GhprbBuildManager;%0Aimport org.jenkinsci.plugins.ghprb.manager.factory.GhprbBuildManagerFactoryUtil;%0Aimport org.jenkinsci.plugins.ghprb.manager.impl.GhprbDefaultBuildManager;%0Aimport org.jenkinsci.plugins.ghprb.manager.impl.downstreambuilds.BuildFlowBuildManager;%0Aimport org.jenkinsci.plugins.ghprb.rules.JenkinsRuleWithBuildFlow;%0A%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0A%0A/**%0A * @author mdelapenya (Manuel de la Pe%C3%B1a)%0A */%0Apublic class GhprbBuildManagerFactoryUtilTest %7B%0A%0A%09@Rule%0A%09public JenkinsRuleWithBuildFlow jenkinsRule = new JenkinsRuleWithBuildFlow();%0A%0A%09@Test%0A%09public void shouldReturnDefaultManager() throws Exception %7B%0A%09%09// GIVEN%0A%09%09MatrixProject project = jenkinsRule.createMatrixProject(%22PRJ%22);%0A%0A%09%09GhprbBuildManager buildManager =%0A%09%09%09GhprbBuildManagerFactoryUtil.getBuildManager(%0A%09%09%09%09new MatrixBuild(project));%0A%0A%09%09// THEN%0A%09%09assertThat(buildManager).isInstanceOf(GhprbDefaultBuildManager.class);%0A%09%7D%0A%0A%09@Test%0A%09public void shouldReturnBuildFlowManager() throws Exception %7B%0A%09%09// GIVEN%0A%09%09BuildFlow buildFlowProject = jenkinsRule.createBuildFlowProject(%22BFPRJ%22);%0A%0A%09%09GhprbBuildManager buildManager =%0A%09%09%09GhprbBuildManagerFactoryUtil.getBuildManager(%0A%09%09%09%09new FlowRun(buildFlowProject));%0A%0A%09%09// THEN%0A%09%09assertThat(buildManager).isInstanceOf(BuildFlowBuildManager.class);%0A%09%7D%0A%0A%7D

add tests to verify that GhprbBuildManager returns the proper instance