Search in sources :

Example 1 with BlackDuckConnectivityChecker

use of com.synopsys.integration.detect.lifecycle.boot.product.BlackDuckConnectivityChecker in project synopsys-detect by blackducksoftware.

the class ProductBootTest method testBoot.

private ProductRunData testBoot(BlackDuckDecision blackDuckDecision, ProductBootOptions productBootOptions, BlackDuckConnectivityResult blackDuckconnectivityResult) throws DetectUserFriendlyException, IOException, IntegrationException {
    ProductBootFactory productBootFactory = Mockito.mock(ProductBootFactory.class);
    Mockito.when(productBootFactory.createPhoneHomeManager(Mockito.any())).thenReturn(null);
    BlackDuckConnectivityChecker blackDuckConnectivityChecker = Mockito.mock(BlackDuckConnectivityChecker.class);
    Mockito.when(blackDuckConnectivityChecker.determineConnectivity(Mockito.any())).thenReturn(blackDuckconnectivityResult);
    AnalyticsConfigurationService analyticsConfigurationService = Mockito.mock(AnalyticsConfigurationService.class);
    Mockito.when(analyticsConfigurationService.fetchAnalyticsSetting(Mockito.any(), Mockito.any())).thenReturn(new AnalyticsSetting("analytics", true));
    ProductBoot productBoot = new ProductBoot(blackDuckConnectivityChecker, analyticsConfigurationService, productBootFactory, productBootOptions);
    return productBoot.boot(blackDuckDecision, null);
}
Also used : AnalyticsSetting(com.synopsys.integration.detect.workflow.blackduck.analytics.AnalyticsSetting) AnalyticsConfigurationService(com.synopsys.integration.detect.workflow.blackduck.analytics.AnalyticsConfigurationService) ProductBootFactory(com.synopsys.integration.detect.lifecycle.boot.product.ProductBootFactory) BlackDuckConnectivityChecker(com.synopsys.integration.detect.lifecycle.boot.product.BlackDuckConnectivityChecker) ProductBoot(com.synopsys.integration.detect.lifecycle.boot.product.ProductBoot)

Example 2 with BlackDuckConnectivityChecker

use of com.synopsys.integration.detect.lifecycle.boot.product.BlackDuckConnectivityChecker in project synopsys-detect by blackducksoftware.

the class InteractiveModeDecisionTreeEndToEndTest method testTraverse.

public void testTraverse(Map<String, String> callToResponse, Map<Property, String> expectedProperties) {
    DetectInfo detectInfo = new DetectInfo("synopsys_detect", OperatingSystemType.LINUX, "unknown");
    InteractiveModeDecisionTree decisionTree = new InteractiveModeDecisionTree(detectInfo, new BlackDuckConnectivityChecker(), new ArrayList<>(), new Gson());
    InteractiveWriter mockWriter = mockWriter(callToResponse);
    InteractivePropertySourceBuilder propertySourceBuilder = new InteractivePropertySourceBuilder(mockWriter);
    decisionTree.traverse(propertySourceBuilder, mockWriter);
    MapPropertySource actualPropertySource = propertySourceBuilder.build();
    expectedProperties.forEach((key, value) -> assertHasPropertyWithValue(actualPropertySource, key, value));
    assertEquals(expectedProperties.keySet().size(), actualPropertySource.getKeys().size());
}
Also used : DetectInfo(com.synopsys.integration.detect.configuration.DetectInfo) MapPropertySource(com.synopsys.integration.configuration.source.MapPropertySource) BlackDuckConnectivityChecker(com.synopsys.integration.detect.lifecycle.boot.product.BlackDuckConnectivityChecker) Gson(com.google.gson.Gson)

Aggregations

BlackDuckConnectivityChecker (com.synopsys.integration.detect.lifecycle.boot.product.BlackDuckConnectivityChecker)2 Gson (com.google.gson.Gson)1 MapPropertySource (com.synopsys.integration.configuration.source.MapPropertySource)1 DetectInfo (com.synopsys.integration.detect.configuration.DetectInfo)1 ProductBoot (com.synopsys.integration.detect.lifecycle.boot.product.ProductBoot)1 ProductBootFactory (com.synopsys.integration.detect.lifecycle.boot.product.ProductBootFactory)1 AnalyticsConfigurationService (com.synopsys.integration.detect.workflow.blackduck.analytics.AnalyticsConfigurationService)1 AnalyticsSetting (com.synopsys.integration.detect.workflow.blackduck.analytics.AnalyticsSetting)1