Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kubernetes/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
app: dpplint
containers:
- name: dpplint
image: oydeu/dpplint@sha256:9a967537cfba81b96ad377bff375fa2ccfe63c7d72a97dbbf5cd22f08798a1ce
image: oydeu/dpplint@sha256:b2a3830a66ec00ccc36eff0e4fd6f52c74cb7da1cd864ca1ac711a735f27b5a1
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
Expand Down
23 changes: 23 additions & 0 deletions test/integration/validations_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,29 @@ def criterion(result, id) = result["criteria"].find { |c| c["id"] == id }
assert_equal "warning", criterion(result, "DPP-DAT-015")["result"]
end

test "GTIN with the GS1 prefix 952 for examples gives a warning on the product identifier scheme" do
result = criterion(lint(reference), "DPP-CAR-002")
assert_equal "warning", result["result"]
assert_equal ["warning"], result["messages"].map { |m| m["severity"] }
assert_match(/GS1 prefix 952/, result["messages"].first["message"])
end

test "GTIN with another prefix passes the product identifier scheme without a warning" do
passport = reference.merge("uniqueProductIdentifier" => "https://dpp.example.org/01/04012345000016/21/000001")
assert_equal "passed", criterion(lint(passport), "DPP-CAR-002")["result"]
passport = reference.merge("uniqueProductIdentifier" => "https://dpp.example.org/01/95201234567897/21/000001")
assert_equal "passed", criterion(lint(passport), "DPP-CAR-002")["result"], "prefix 520 after the indicator digit 9"
end

test "product identifier in the form the EU DPP registry accepts" do
assert_equal "passed", criterion(lint(reference), "DPP-REG-024")["result"]
result = criterion(lint(reference.merge("uniqueProductIdentifier" => "did:web:dpp.example.org:product:4711")), "DPP-REG-024")
assert_equal "failed", result["result"]
assert_match(/2000 characters/, result["messages"].first["message"])
long = "https://dpp.example.org/01/04012345000016/21/#{'1' * 2000}"
assert_equal "failed", criterion(lint(reference.merge("uniqueProductIdentifier" => long)), "DPP-REG-024")["result"]
end

test "optional facility identifier is skipped when absent" do
assert_equal "skipped", criterion(lint(reference), "DPP-ID-010")["result"]
end
Expand Down
Loading