Search in sources :

Example 1 with ProductBootOptions

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);
}
Also used : BlackDuckConnectivityResult(com.synopsys.integration.detect.lifecycle.boot.product.BlackDuckConnectivityResult) ProductBootOptions(com.synopsys.integration.detect.lifecycle.boot.product.ProductBootOptions) BlackDuckServicesFactory(com.synopsys.integration.blackduck.service.BlackDuckServicesFactory) ProductRunData(com.synopsys.integration.detect.lifecycle.run.data.ProductRunData) BlackDuckServerConfig(com.synopsys.integration.blackduck.configuration.BlackDuckServerConfig) Test(org.junit.jupiter.api.Test)

Example 2 with ProductBootOptions

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());
}
Also used : BlackDuckConnectivityResult(com.synopsys.integration.detect.lifecycle.boot.product.BlackDuckConnectivityResult) ProductBootOptions(com.synopsys.integration.detect.lifecycle.boot.product.ProductBootOptions) ProductRunData(com.synopsys.integration.detect.lifecycle.run.data.ProductRunData) Test(org.junit.jupiter.api.Test)

Example 3 with ProductBootOptions

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());
}
Also used : BlackDuckConnectivityResult(com.synopsys.integration.detect.lifecycle.boot.product.BlackDuckConnectivityResult) ProductBootOptions(com.synopsys.integration.detect.lifecycle.boot.product.ProductBootOptions) BlackDuckServicesFactory(com.synopsys.integration.blackduck.service.BlackDuckServicesFactory) ProductRunData(com.synopsys.integration.detect.lifecycle.run.data.ProductRunData) BlackDuckServerConfig(com.synopsys.integration.blackduck.configuration.BlackDuckServerConfig) Test(org.junit.jupiter.api.Test)

Example 4 with ProductBootOptions

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));
}
Also used : BlackDuckConnectivityResult(com.synopsys.integration.detect.lifecycle.boot.product.BlackDuckConnectivityResult) ProductBootOptions(com.synopsys.integration.detect.lifecycle.boot.product.ProductBootOptions) Test(org.junit.jupiter.api.Test)

Example 5 with ProductBootOptions

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));
}
Also used : BlackDuckConnectivityResult(com.synopsys.integration.detect.lifecycle.boot.product.BlackDuckConnectivityResult) ProductBootOptions(com.synopsys.integration.detect.lifecycle.boot.product.ProductBootOptions) Test(org.junit.jupiter.api.Test)

Aggregations

BlackDuckConnectivityResult (com.synopsys.integration.detect.lifecycle.boot.product.BlackDuckConnectivityResult)5 ProductBootOptions (com.synopsys.integration.detect.lifecycle.boot.product.ProductBootOptions)5 Test (org.junit.jupiter.api.Test)5 ProductRunData (com.synopsys.integration.detect.lifecycle.run.data.ProductRunData)3 BlackDuckServerConfig (com.synopsys.integration.blackduck.configuration.BlackDuckServerConfig)2 BlackDuckServicesFactory (com.synopsys.integration.blackduck.service.BlackDuckServicesFactory)2