Energinet-DataHub / ARCHIVED-geh-charges

Apache License 2.0
7 stars 3 forks source link

fix: empty and whitespace elements for required elements when parsing cim document is now handled #1855

Closed x-platformcoder closed 1 year ago

x-platformcoder commented 1 year ago

Description

When CIM messages are parsed and required elements are either empty, only contain whitespace, or have a value that Charges do not support, and the possibility to handle those cases with asynchronous errors is not possible a bad request = "400" is returned with an error code "B2B-005" and an error message describing the problem as an XML message

References

codecov[bot] commented 1 year ago

Codecov Report

Merging #1855 (6c77aa7) into main (667aeb3) will decrease coverage by 0.25%. The diff coverage is 76.13%.

@@            Coverage Diff             @@
##             main    #1855      +/-   ##
==========================================
- Coverage   84.39%   84.14%   -0.26%     
==========================================
  Files         469      450      -19     
  Lines        8072     7888     -184     
  Branches      433       22     -411     
==========================================
- Hits         6812     6637     -175     
+ Misses       1174     1123      -51     
- Partials       86      128      +42     
Flag Coverage Δ
business 87.64% <76.13%> (?)
clientlibraries 32.73% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...s.FunctionHost/ChargeLinks/ChargeLinksIngestion.cs 0.00% <0.00%> (ø)
...ub.Charges.FunctionHost/Charges/ChargeIngestion.cs 0.00% <0.00%> (ø)
...ization/MarketDocument/InvalidXmlValueException.cs 84.61% <84.61%> (ø)
...on/ChargeInformationCommandReceivedEventHandler.cs 100.00% <100.00%> (ø)
...ost/Charges/Handlers/ChargeCommandBundleHandler.cs 100.00% <100.00%> (ø)
...Host/Configuration/ChargeIngestionConfiguration.cs 100.00% <100.00%> (ø)
...astructure.Core/Function/B2BErrorMessageFactory.cs 100.00% <100.00%> (ø)
...nfrastructure.Core/Function/HttpResponseBuilder.cs 94.73% <100.00%> (-0.51%) :arrow_down:
...ation/ChargeBundle/ChargeCommandBundleConverter.cs 98.66% <100.00%> (+0.97%) :arrow_up:
...eserialization/MarketDocument/DocumentConverter.cs 98.78% <100.00%> (+0.39%) :arrow_up:
... and 81 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication