use of com.synopsys.integration.detect.lifecycle.boot.product.ProductBootOptions in project synopsys-detect by blackducksoftware.
the class ProductBootTest method blackDuckConnectionSuccessWithTestReturnsNull.
@Test
public void blackDuckConnectionSuccessWithTestReturnsNull() throws DetectUserFriendlyException, IOException, IntegrationException {
BlackDuckConnectivityResult connectivityResult = BlackDuckConnectivityResult.success(Mockito.mock(BlackDuckServicesFactory.class), Mockito.mock(BlackDuckServerConfig.class));
ProductRunData productRunData = testBoot(BlackDuckDecision.runOnline(BlackduckScanMode.INTELLIGENT), new ProductBootOptions(false, true), connectivityResult);
Assertions.assertNull(productRunData);
}
use of com.synopsys.integration.detect.lifecycle.boot.product.ProductBootOptions in project synopsys-detect by blackducksoftware.
the class ProductBootTest method blackDuckFailureWithIgnoreReturnsFalse.
@Test
public void blackDuckFailureWithIgnoreReturnsFalse() throws DetectUserFriendlyException, IOException, IntegrationException {
BlackDuckConnectivityResult connectivityResult = BlackDuckConnectivityResult.failure("Failed to connect");
ProductRunData productRunData = testBoot(BlackDuckDecision.runOnline(BlackduckScanMode.INTELLIGENT), new ProductBootOptions(true, false), connectivityResult);
Assertions.assertFalse(productRunData.shouldUseBlackDuckProduct());
}
use of com.synopsys.integration.detect.lifecycle.boot.product.ProductBootOptions in project synopsys-detect by blackducksoftware.
the class ProductBootTest method blackDuckOnlyWorks.
@Test
public void blackDuckOnlyWorks() throws DetectUserFriendlyException, IOException, IntegrationException {
BlackDuckConnectivityResult connectivityResult = BlackDuckConnectivityResult.success(Mockito.mock(BlackDuckServicesFactory.class), Mockito.mock(BlackDuckServerConfig.class));
ProductRunData productRunData = testBoot(BlackDuckDecision.runOnline(BlackduckScanMode.INTELLIGENT), new ProductBootOptions(false, false), connectivityResult);
Assertions.assertTrue(productRunData.shouldUseBlackDuckProduct());
}
use of com.synopsys.integration.detect.lifecycle.boot.product.ProductBootOptions in project synopsys-detect by blackducksoftware.
the class ProductBootTest method blackDuckConnectionFailureWithTestThrows.
@Test
public void blackDuckConnectionFailureWithTestThrows() {
BlackDuckConnectivityResult connectivityResult = BlackDuckConnectivityResult.failure("Failed to connect");
Assertions.assertThrows(DetectUserFriendlyException.class, () -> testBoot(BlackDuckDecision.runOnline(BlackduckScanMode.INTELLIGENT), new ProductBootOptions(false, true), connectivityResult));
}
use of com.synopsys.integration.detect.lifecycle.boot.product.ProductBootOptions in project synopsys-detect by blackducksoftware.
the class ProductBootTest method blackDuckConnectionFailureThrows.
@Test
public void blackDuckConnectionFailureThrows() {
BlackDuckConnectivityResult connectivityResult = BlackDuckConnectivityResult.failure("Failed to connect");
Assertions.assertThrows(DetectUserFriendlyException.class, () -> testBoot(BlackDuckDecision.runOnline(BlackduckScanMode.INTELLIGENT), new ProductBootOptions(false, false), connectivityResult));
}
Aggregations