Skip to content

Commit

Permalink
fix: review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
eschrewe committed Apr 3, 2024
1 parent b693ba4 commit ffca4e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ public List<ReportedProductItemStock> itemStockSammToReportedProductItemStock(It
return outputList;
}

// When deserializing a Samm from a customer, who has sent a report on the
// stocks he received from us, the materialGlobalAssetId used in the communication
// was set by us (as the supplying side). Therefore the materialGlobalAssetId in
// the Samm is the one in our Material entity.
Material material = materialService.findByMaterialNumberCx(matNbrCatenaX);
if (material == null) {
log.warn("Could not identify materialPartnerRelation with matNbrCatenaX " + matNbrCatenaX + " and partner bpnl " + partner.getBpnl());
Expand All @@ -130,8 +134,6 @@ public List<ReportedProductItemStock> itemStockSammToReportedProductItemStock(It

var mpr = mprService.find(material, partner);



for (var position : samm.getPositions()) {
String supplierOrderId = null, customerOrderPositionId = null, customerOrderId = null;
if (position.getOrderPositionReference() != null) {
Expand Down Expand Up @@ -173,13 +175,16 @@ public List<ReportedMaterialItemStock> itemStockSammToReportedMaterialItemStock(
log.warn("Could not identify materialPartnerRelation with matNbrCatenaX " + matNbrCatenaX + " and partner bpnl " + partner.getBpnl());

Check failure

Code scanning / CodeQL

Log Injection High

This log entry depends on a
user-provided value
.
return outputList;
}
// When deserializing a Samm from a supplier, who has sent a report on the
// stocks he has prepared for us, the materialGlobalAssetId used in the communication
// was set by the supplying partner. Therefore the materialGlobalAssetId in
// the Samm is the one in our MaterialPartnerRelation entity with that partner.
Material material = mpr.getMaterial();
if (material == null) {
log.warn("Could not identify material with CatenaXNbr " + matNbrCatenaX);
return outputList;
}


for (var position : samm.getPositions()) {
String supplierOrderId = null, customerOrderPositionId = null, customerOrderId = null;
if (position.getOrderPositionReference() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ void test_unmarshalling() {
mpr.setPartnerMaterialNumber(CUSTOMER_MAT_NUMBER);
mpr.setPartnerCXNumber(CX_MAT_NUMBER);

// when(mprService.findByPartnerAndPartnerCXNumber(customerPartner, CX_MAT_NUMBER)).thenReturn(mpr);
when(materialService.findByMaterialNumberCx(CX_MAT_NUMBER)).thenReturn(material);
when(mprService.find(material, customerPartner)).thenReturn(mpr);

Expand Down

0 comments on commit ffca4e1

Please sign in to comment.