Skip to content

Add the invalid-document fixtures the validation service tests need - #12

Open
sboeckelmann wants to merge 1 commit into
mainfrom
feature/validation-message-fixtures
Open

Add the invalid-document fixtures the validation service tests need#12
sboeckelmann wants to merge 1 commit into
mainfrom
feature/validation-message-fixtures

Conversation

@sboeckelmann

Copy link
Copy Markdown
Contributor

Unblocks openepcis/openepcis-document-validation-service#7, whose CI is red because it moved its tests onto the shared fixtures and 34 of the paths it references never existed here.

What is added

  • 2.0/EPCIS/{XML,JSON}/Capture/Invalid/ — one deliberate mistake per document, so a test can assert a single error and check the field, the value and the suggestion it offers
  • 2.0/EPCIS/{XML,JSON}/Query/Queries/ and .../Query/Invalid/ — literal queries and query documents, valid and invalid
  • 2.0/EPCIS/JSON/Query/queryDocument.json, 2.0/EPCIS/XML/Query/QueryDocumentWithMultipleEvents.xml
  • 1.2/EPCIS/XML/Capture/Documents/EPCISDocument_with_comment.xml
  • 2.0/EPCIS/JSON/Capture/Documents/ObjectEvent_with_custom_bizStep_uri.json

The combination fixtures carry one mistake per event, which is what the ordering and front-end contract tests need.

Fixture design

Values were chosen against the real vocabularies so the suggester behaves as the consuming tests expect:

Fixture Value Why
non-standard bizStep transforming 2 edits from transporting, inside the threshold
non-standard disposition intransit 1 edit from in_transit
invalid action CREATE past the threshold, so no suggestion is offered
near-miss action OBSERV 1 edit from OBSERVE

Incidental fixes

scripts/generate-file-list.sh still pointed at src/main/resources from before the core/ module split, so it produced an empty list and nobody could regenerate the manifest. Repaired, and pinned to LC_ALL=C so the order does not depend on the committer's locale.

Regenerating it revealed the manifest had drifted: epcisDocWithAllGS1Keys and epcisDocWithSensorComponent (XML and JSON) were committed but absent from the list, so ResourceFinder could not enumerate them. They are now listed.

Verification

With this branch installed locally, the full mvn clean verify reactor of openepcis-document-validation-service#7 passes: 90/90 in core, all nine modules green.

openepcis-document-validation-service moved its tests onto the shared
fixtures and expects an Invalid/ tree for XML and JSON capture, a
Queries/ tree for literal JSON and XML queries, and an EPCIS 1.2
document with comments. None of those existed here, so every one of
those tests failed on a null InputStream.

Each invalid fixture carries exactly one mistake, so a test can assert a
single error and name the field, the value and the suggestion. The
combination fixtures carry one mistake per event to cover ordering and
the front-end contract guards.

Also regenerate openepcis-test-resources.list and repair the script that
writes it: it still pointed at src/main/resources from before the core/
module split, so it silently produced an empty list. The manifest had
drifted and was missing four documents that were already committed;
ResourceFinder could not see them.
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.

1 participant