use of org.jboss.pnc.test.cdi.TestInstance in project pnc by project-ncl.
the class BuildDriverFactoryTest method shouldSkipDriversWhichAreNotMentionedInConfiguration.
@Test(expected = ExecutorException.class)
public void shouldSkipDriversWhichAreNotMentionedInConfiguration() throws Exception {
// given
ProperDriver testedBuildDriver = new ProperDriver();
TestInstance<BuildDriver> allDrivers = new TestInstance<>(testedBuildDriver);
Configuration configuration = new Configuration();
BuildDriverFactory factory = new BuildDriverFactory(allDrivers, configuration);
factory.initConfiguration();
// when
factory.getBuildDriver();
}
use of org.jboss.pnc.test.cdi.TestInstance in project pnc by project-ncl.
the class BuildDriverFactoryTest method shouldPickProperDriver.
@Test
public void shouldPickProperDriver() throws Exception {
// given
ProperDriver testedBuildDriver = new ProperDriver();
TestInstance<BuildDriver> allDrivers = new TestInstance<>(testedBuildDriver);
Configuration configuration = mock(Configuration.class);
BuildDriverFactory factory = new BuildDriverFactory(allDrivers, configuration);
// when
BuildDriver buildDriver = factory.getBuildDriver();
// then
assertThat(buildDriver).isEqualTo(testedBuildDriver);
}
Aggregations