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);
}
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());
}
Aggregations