use of com.synopsys.integration.blackduck.api.manual.temporary.enumeration.ProjectVersionPhaseType in project synopsys-detect by blackducksoftware.
the class DetectConfigurationFactory method createDetectProjectServiceOptions.
public ProjectSyncOptions createDetectProjectServiceOptions() {
ProjectVersionPhaseType projectVersionPhase = detectConfiguration.getValue(DetectProperties.DETECT_PROJECT_VERSION_PHASE);
ProjectVersionDistributionType projectVersionDistribution = detectConfiguration.getValue(DetectProperties.DETECT_PROJECT_VERSION_DISTRIBUTION);
Integer projectTier = detectConfiguration.getNullableValue(DetectProperties.DETECT_PROJECT_TIER);
String projectDescription = detectConfiguration.getNullableValue(DetectProperties.DETECT_PROJECT_DESCRIPTION);
String projectVersionNotes = detectConfiguration.getNullableValue(DetectProperties.DETECT_PROJECT_VERSION_NOTES);
List<ProjectCloneCategoriesType> cloneCategories = detectConfiguration.getValue(DetectProperties.DETECT_PROJECT_CLONE_CATEGORIES).representedValues();
Boolean projectLevelAdjustments = detectConfiguration.getValue(DetectProperties.DETECT_PROJECT_LEVEL_ADJUSTMENTS);
Boolean forceProjectVersionUpdate = detectConfiguration.getValue(DetectProperties.DETECT_PROJECT_VERSION_UPDATE);
String projectVersionNickname = detectConfiguration.getNullableValue(DetectProperties.DETECT_PROJECT_VERSION_NICKNAME);
return new ProjectSyncOptions(projectVersionPhase, projectVersionDistribution, projectTier, projectDescription, projectVersionNotes, cloneCategories, forceProjectVersionUpdate, projectVersionNickname, projectLevelAdjustments);
}
use of com.synopsys.integration.blackduck.api.manual.temporary.enumeration.ProjectVersionPhaseType in project blackduck-common by blackducksoftware.
the class ComprehensiveCookbookTestIT method createProjectVersionSingleCall.
@Test
public void createProjectVersionSingleCall() throws Exception {
String testProjectName = intHttpClientTestHelper.getProperty("TEST_CREATE_PROJECT");
ProjectService projectService = blackDuckServicesFactory.createProjectService();
BlackDuckApiClient blackDuckApiClient = blackDuckServicesFactory.getBlackDuckApiClient();
IntLogger logger = blackDuckServicesFactory.getLogger();
// delete the project, if it exists
intHttpClientTestHelper.deleteIfProjectExists(logger, projectService, blackDuckApiClient, testProjectName);
// get the count of all projects now
int projectCount = blackDuckApiClient.getAllResponses(apiDiscovery.metaProjectsLink()).size();
String versionName = "RestConnectionTest";
ProjectVersionDistributionType distribution = ProjectVersionDistributionType.INTERNAL;
ProjectVersionPhaseType phase = ProjectVersionPhaseType.DEVELOPMENT;
ProjectSyncModel projectSyncModel = new ProjectSyncModel(testProjectName, versionName);
projectSyncModel.setPhase(phase);
projectSyncModel.setDistribution(distribution);
ProjectRequest projectRequest = projectSyncModel.createProjectRequest();
// create the project
ProjectVersionWrapper projectVersionWrapper = projectService.createProject(projectRequest);
ProjectView projectItem = projectVersionWrapper.getProjectView();
Optional<ProjectView> projectItemFromName = projectService.getProjectByName(testProjectName);
// should return the same project
assertTrue(projectItemFromName.isPresent());
assertEquals(projectItem.toString(), projectItemFromName.get().toString());
int projectCountAfterCreate = blackDuckApiClient.getAllResponses(apiDiscovery.metaProjectsLink()).size();
assertTrue(projectCountAfterCreate > projectCount);
Optional<ProjectVersionView> projectVersionItem = projectService.getProjectVersion(projectItem, versionName);
assertTrue(projectVersionItem.isPresent());
assertEquals(versionName, projectVersionItem.get().getVersionName());
// should return the same project version
assertEquals(projectVersionWrapper.getProjectVersionView().toString(), projectVersionItem.get().toString());
}
Aggregations