Search in sources :

Example 6 with ProjectVersionPolicyStatusView

use of com.synopsys.integration.blackduck.api.generated.view.ProjectVersionPolicyStatusView in project blackduck-common by blackducksoftware.

the class PolicyStatusDescriptionTest method testMessageHandlesSingularComponents.

@Test
public void testMessageHandlesSingularComponents() {
    ProjectVersionPolicyStatusView policyStatusItem = createProjectVersionPolicyStatusView();
    PolicyStatusDescription policyStatusDescription = new PolicyStatusDescription(policyStatusItem);
    String message = policyStatusDescription.getPolicyStatusMessage();
    Assertions.assertEquals("Black Duck found: 4 components in violation (Policy Severity counts: 1 match has a severity level of TRIVIAL, 3 matches have a severity level of BLOCKER), 0 components in violation, but overridden, and 1 component not in violation.", message);
    Assertions.assertNotNull(message);
}
Also used : PolicyStatusDescription(com.synopsys.integration.blackduck.service.model.PolicyStatusDescription) ProjectVersionPolicyStatusView(com.synopsys.integration.blackduck.api.generated.view.ProjectVersionPolicyStatusView) Test(org.junit.jupiter.api.Test)

Aggregations

ProjectVersionPolicyStatusView (com.synopsys.integration.blackduck.api.generated.view.ProjectVersionPolicyStatusView)6 Test (org.junit.jupiter.api.Test)4 ProjectVersionView (com.synopsys.integration.blackduck.api.generated.view.ProjectVersionView)2 PolicyStatusDescription (com.synopsys.integration.blackduck.service.model.PolicyStatusDescription)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Gson (com.google.gson.Gson)1 ExternalId (com.synopsys.integration.bdio.model.externalid.ExternalId)1 ProjectVersionPolicyStatusComponentVersionPolicyViolationDetailsView (com.synopsys.integration.blackduck.api.generated.component.ProjectVersionPolicyStatusComponentVersionPolicyViolationDetailsView)1 PolicyRuleView (com.synopsys.integration.blackduck.api.generated.view.PolicyRuleView)1 ProjectVersionComponentVersionView (com.synopsys.integration.blackduck.api.generated.view.ProjectVersionComponentVersionView)1 NameValuePairView (com.synopsys.integration.blackduck.api.manual.temporary.component.NameValuePairView)1 BlackDuckHttpClient (com.synopsys.integration.blackduck.http.client.BlackDuckHttpClient)1 BlackDuckJsonTransformer (com.synopsys.integration.blackduck.http.transform.BlackDuckJsonTransformer)1 BlackDuckResponseTransformer (com.synopsys.integration.blackduck.http.transform.BlackDuckResponseTransformer)1 BlackDuckResponsesTransformer (com.synopsys.integration.blackduck.http.transform.BlackDuckResponsesTransformer)1 BlackDuckResponseResolver (com.synopsys.integration.blackduck.http.transform.subclass.BlackDuckResponseResolver)1 ProjectVersionWrapper (com.synopsys.integration.blackduck.service.model.ProjectVersionWrapper)1 BlackDuckRequest (com.synopsys.integration.blackduck.service.request.BlackDuckRequest)1 BufferedIntLogger (com.synopsys.integration.log.BufferedIntLogger)1 IntLogger (com.synopsys.integration.log.IntLogger)1