How To Run Tests

In addition to the provided samples, there are also tests written in the repository. These tests work similarly to the samples but automatically verify the correct behavior of the SDK using the testing package.

1

Create a test license

Create a license with product code test.

This license must support:

  • Online activation

  • Consumption

  • Borrowing

  • Floating cloud

  • It must have available floating slots and consumption units

  • It must also include a feature with:

    • Floating cloud consumption

    • Feature code: testFeature

    • Available floating slots and consumption units

2

Run the core tests

Once the license above is created, run the following tests:

  • TestLicenseConsumption

  • TestActivateLicense

  • TestLicenseFeatureConsumption

  • TestLicenseCheckAndRelease

  • TestLicenseFeatureCheckAndRelease

  • TestLicenseFloatingBorrow

3

Additional test cases

  • Create a license with product code testDisabled, disable it, then run:

    • TestActivateDisabledLicense

  • Create an expired license with product code testExpired, then run:

    • TestExpiredLicenseCheck

4

What the tests do

These tests automatically:

  • Activate licenses

  • Update consumptions

  • Check licenses

  • Perform releases

They validate that changes are properly reflected both in the license response and local storage.

5

Configure config.yaml

To run the tests correctly, you must configure your config.yaml file properly by providing the necessary credentials and license details.

config.yaml
clientId: "your-client-id"
clientSecret: "your-client-secret"
cryptoProviderKey: "your-crypto-provider-key" # Required if using OAuth
apiKey: "your-api-key"
sharedKey: "your-shared-key"
verbose: true
verify_signature: true

products:
  productCode1:
    licenseKey: "your-license-key"
  productCode2:
    username: "your-username"
    password: "your-password"
circle-exclamation

Was this helpful?