-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: demand and capacity notification improvements #576
base: main
Are you sure you want to change the base?
feat: demand and capacity notification improvements #576
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please test correct mapping of all fields. Beside that you solved #486 ! Thanks a lot :)
...demandandcapacitynotification/logic/adapter/DemandAndCapacityNotificationSammMapperTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently only serialization has been checked with regard to material mapping. Please also add mapping assertions for deserialization.
Assertions.assertEquals(StatusEnumeration.OPEN, reportedDemandAndCapacityNotification.getStatus()); | ||
Assertions.assertEquals(LeadingRootCauseEnumeration.LOGISTICS_DISRUPTION, reportedDemandAndCapacityNotification.getLeadingRootCause()); | ||
Assertions.assertEquals(EffectEnumeration.CAPACITY_REDUCTION, reportedDemandAndCapacityNotification.getEffect()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add assertions for material numbers. Currently we have checks only for serialization but not for deserialization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test asserts, that the ReportedDemandAndCapacityNotification entity, we receive from the Samm Mapper contains the expected material entity (and no other material). see lines 205, 206.
The ReportedDemandAndCapacityNotification in itself does not contain any material numbers, so there is nothing to assert here. The material numbers only exist as members of the material entities / mpr entities.
Perhaps some more explanation, what this test method is actually meant to do, might be helpful:
The "testSammDeSerializationAsCustomer" is focused on showing, whether the material identification logic in the DemandAndCapacityNotificationSammMapper (lines 97 - 121) works as expected.
The SAMM's usually contain redundat information on the affected materials, since they (usually) not only contain a the CX-id but also the customer-/supplier materialnumbers.
This test is repeated three times with different samm inputs. While the first input "regularSammFromSupplier" contains fully redundant information, the other two tests cases have partially missing information ("sammWithoutCXIdFromSupplier", "sammWithoutCXIdAndSupplierMnrFromSupplier")
for (var field: jsonNode.get("materialNumberCustomer")) { | ||
Assertions.assertEquals(CUSTOMER_MAT_NUMBER, field.asText()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add check for cx material number as it has been set to partnerMaterialNumberCx
previously
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
Assertions.assertEquals(StatusEnumeration.OPEN, reportedDemandAndCapacityNotification.getStatus()); | ||
Assertions.assertEquals(LeadingRootCauseEnumeration.LOGISTICS_DISRUPTION, reportedDemandAndCapacityNotification.getLeadingRootCause()); | ||
Assertions.assertEquals(EffectEnumeration.CAPACITY_REDUCTION, reportedDemandAndCapacityNotification.getEffect()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. Please add material number checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
Description
Pre-review checks
Please ensure to do as many of the following checks as possible, before asking for committer review: