Add the invalid-document fixtures the validation service tests need - #12
Open
sboeckelmann wants to merge 1 commit into
Open
Add the invalid-document fixtures the validation service tests need#12sboeckelmann wants to merge 1 commit into
sboeckelmann wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 offers2.0/EPCIS/{XML,JSON}/Query/Queries/and.../Query/Invalid/— literal queries and query documents, valid and invalid2.0/EPCIS/JSON/Query/queryDocument.json,2.0/EPCIS/XML/Query/QueryDocumentWithMultipleEvents.xml1.2/EPCIS/XML/Capture/Documents/EPCISDocument_with_comment.xml2.0/EPCIS/JSON/Capture/Documents/ObjectEvent_with_custom_bizStep_uri.jsonThe 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:
transformingtransporting, inside the thresholdintransitin_transitCREATEOBSERVOBSERVEIncidental fixes
scripts/generate-file-list.shstill pointed atsrc/main/resourcesfrom before thecore/module split, so it produced an empty list and nobody could regenerate the manifest. Repaired, and pinned toLC_ALL=Cso the order does not depend on the committer's locale.Regenerating it revealed the manifest had drifted:
epcisDocWithAllGS1KeysandepcisDocWithSensorComponent(XML and JSON) were committed but absent from the list, soResourceFindercould not enumerate them. They are now listed.Verification
With this branch installed locally, the full
mvn clean verifyreactor of openepcis-document-validation-service#7 passes: 90/90 in core, all nine modules green.