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

Java SDK tests against examples from the spec repo #63

Merged
merged 3 commits into from
Jan 11, 2024

Conversation

rjalander
Copy link
Contributor

This PR includes the changes to,

  1. Fix the issue Java SDK tests against schemas and examples in the spec repo #28 to add tests to compare examples from spec repo
  2. Adding methods to create and validate a CDEvent in a Json string format and tests to validate
  3. Updating events to generate hashCode() and equals() methods to validate the Objects

@@ -1,22 +1,42 @@
package dev.cdevents.constants;

import dev.cdevents.events.*;
Copy link

@andrew-est andrew-est Dec 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this pass linting?
Maybe a comment on why the import ...* i.e we need all the events

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting doesn't stop this

Copy link

@andrew-est andrew-est left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me

Comment on lines +37 to +41
createdEvent.setSource(URI.create("/event/source/123"));
createdEvent.setSubjectId("pkg:golang/mygit.com/myorg/myapp@234fd47e07d1004f0aed9c");
createdEvent.setSubjectSource(URI.create("/event/source/123"));
createdEvent.setSubjectChangeId("myChange123");
createdEvent.setSubjectChangeSource("my-git.example/an-org/a-repo");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for this section, these tests can also be generated or generalised eventually

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do a refactor of these tests in a separate PR

@rjalander rjalander force-pushed the SDK_Test_Examples branch 3 times, most recently from cf1a64c to ef4aeeb Compare January 11, 2024 10:49
update unit testing for new events

add unit testing for CDEventClass generated for each schema file

Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Signed-off-by: Jalander Ramagiri <jalander.ramagiri@est.tech>
Copy link
Contributor

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this! lgtm

@afrittoli afrittoli merged commit 7de4f78 into cdevents:main Jan 11, 2024
3 checks passed
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.

None yet

3 participants