Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for every contract endpoint. #90

Merged
merged 1 commit into from
Dec 11, 2024
Merged

Conversation

ainmosni
Copy link
Contributor

This adds tests for every contract HTTP endpoint on both the provider
and consumer side. These tests are based on the examples in the
IDSA dataspace specification.

The average test goes as follows:

  1. Create a starting state.
  2. Submit the message to the correct endpoint.
  3. Inspect if the response is correct.
  4. Inspect if the storage is in the desired state.
  5. Inspect if the right request will be sent out to the reconciliation
    loop.

These tests also exposed some small bugs that are now fixed:

  • The reconciler is now an interface to make testing possible.
  • SetConsumerPID now actually sets the consumer PID.
  • Unify the termination handler as they are on the same path
    for both the consumer and provider flows.
  • Fix some ODRL validators.
  • Fix the JSON-LD unmarshaller, as it put a nil where it shouldn't be.

This adds tests for every contract HTTP endpoint on both the provider
and consumer side. These tests are based on the examples in the
[IDSA dataspace specification](https://docs.internationaldataspaces.org/ids-knowledgebase/dataspace-protocol/contract-negotiation/contract.negotiation.protocol).

The average test goes as follows:

1. Create a starting state.
2. Submit the message to the correct endpoint.
3. Inspect if the response is correct.
4. Inspect if the storage is in the desired state.
5. Inspect if the right request will be sent out to the reconciliation
   loop.

These tests also exposed some small bugs that are now fixed:

- The reconciler is now an interface to make testing possible.
- SetConsumerPID now actually sets the consumer PID.
- Unify the termination handler as they are on the same path
  for both the consumer and provider flows.
- Fix some ODRL validators.
- Fix the JSON-LD unmarshaller, as it put a nil where it shouldn't be.
@Excds Excds merged commit 55abe33 into main Dec 11, 2024
6 checks passed
@Excds Excds deleted the ainmosni/feature/dsp-testing branch December 11, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants