Search in sources :

Example 1 with ComplexLicenseRequest

use of com.synopsys.integration.blackduck.api.manual.temporary.component.ComplexLicenseRequest in project blackduck-common by blackducksoftware.

the class ProjectServiceTestIT method testSetLicenseForProjectVersion.

@Test
public void testSetLicenseForProjectVersion() throws IntegrationException {
    String projectName = "InitialName";
    deleteProjectIfExists(projectName);
    ProjectRequest projectRequest = new ProjectRequest();
    projectRequest.setName(projectName);
    projectRequest.setProjectTier(2);
    projectRequest.setDescription("Initial Description");
    ProjectVersionRequest projectVersionRequest = new ProjectVersionRequest();
    projectVersionRequest.setVersionName("InitialVersion");
    projectVersionRequest.setPhase(ProjectVersionPhaseType.DEVELOPMENT);
    projectVersionRequest.setDistribution(ProjectVersionDistributionType.OPENSOURCE);
    ComplexLicenseRequest complexLicenseRequest = new ComplexLicenseRequest();
    String licenseName = ".NETZ GPL 2.0 With Exception License";
    complexLicenseRequest.setLicense(licenseService.getLicenseUrlByLicenseName(licenseName).get().string());
    projectVersionRequest.setLicense(complexLicenseRequest);
    projectRequest.setVersionRequest(projectVersionRequest);
    ProjectVersionWrapper projectVersionWrapper = ProjectServiceTestIT.projectService.createProject(projectRequest);
    ProjectVersionView projectVersion = projectVersionWrapper.getProjectVersionView();
    Assertions.assertEquals(licenseName, projectVersion.getLicense().getLicenseDisplay());
}
Also used : ProjectRequest(com.synopsys.integration.blackduck.api.manual.temporary.component.ProjectRequest) ProjectVersionView(com.synopsys.integration.blackduck.api.generated.view.ProjectVersionView) ProjectVersionWrapper(com.synopsys.integration.blackduck.service.model.ProjectVersionWrapper) ComplexLicenseRequest(com.synopsys.integration.blackduck.api.manual.temporary.component.ComplexLicenseRequest) ProjectVersionRequest(com.synopsys.integration.blackduck.api.manual.temporary.component.ProjectVersionRequest) Test(org.junit.jupiter.api.Test)

Example 2 with ComplexLicenseRequest

use of com.synopsys.integration.blackduck.api.manual.temporary.component.ComplexLicenseRequest in project blackduck-common by blackducksoftware.

the class ProjectSyncModel method createComplexLicenseRequest.

public ComplexLicenseRequest createComplexLicenseRequest() {
    ComplexLicenseRequest complexLicenseRequest = new ComplexLicenseRequest();
    complexLicenseRequest.setLicense(versionLicenseUrl);
    return complexLicenseRequest;
}
Also used : ComplexLicenseRequest(com.synopsys.integration.blackduck.api.manual.temporary.component.ComplexLicenseRequest)

Aggregations

ComplexLicenseRequest (com.synopsys.integration.blackduck.api.manual.temporary.component.ComplexLicenseRequest)2 ProjectVersionView (com.synopsys.integration.blackduck.api.generated.view.ProjectVersionView)1 ProjectRequest (com.synopsys.integration.blackduck.api.manual.temporary.component.ProjectRequest)1 ProjectVersionRequest (com.synopsys.integration.blackduck.api.manual.temporary.component.ProjectVersionRequest)1 ProjectVersionWrapper (com.synopsys.integration.blackduck.service.model.ProjectVersionWrapper)1 Test (org.junit.jupiter.api.Test)1