Class CoverageIntegration

java.lang.Object
com.parasoft.coverage.integration.api.CoverageIntegration

public final class CoverageIntegration extends Object
Utility methods for user tests and applications under test that need access to the current Parasoft coverage integration context.
  • Field Details

    • BAGGAGE_HEADER_NAME

      public static final String BAGGAGE_HEADER_NAME
      Name of the HTTP header that carries W3C baggage.
      See Also:
    • TEST_OPERATOR_ID_BAGGAGE_KEY

      public static final String TEST_OPERATOR_ID_BAGGAGE_KEY
      W3C baggage key used for the current test operator identifier.
      See Also:
  • Method Details

    • createApiClient

      public static CoverageApiClient createApiClient()
      Creates a coverage API client from coverage-integration.properties and system properties.

      This is intended for rare standalone use cases, such as a main method or custom test harness. JUnit users should prefer the JUnit integration modules.

      Returns:
      a coverage API client
    • getBaggageHeader

      public static String getBaggageHeader()
      Returns the value to use for the Baggage HTTP header for the currently executing test.
      Returns:
      the Baggage header value returned by the CTP /test/start API, or null when no baggage value applies to the current test
    • getCurrentTestOperatorIdHeader

      public static Map<String,String> getCurrentTestOperatorIdHeader()
      Returns the Baggage HTTP header that contains the current test-operator-id returned by the CTP /test/start API.
      Returns:
      a map containing the Baggage header name and value, or an empty map when no current test operator ID applies to the current test