@@ -72,17 +72,22 @@ private InfrastructureAuditResponse getInfrastructureScanResponse(CollectorItem
72
72
infrastructureAuditResponse .setLastUpdated (collectorItem .getLastUpdated ());
73
73
74
74
List <InfrastructureScan > infrastructureScans = infrastructureScanRepository .findByCollectorItemIdAndTimestampIsBetweenOrderByTimestampDesc (collectorItem .getId (), beginDate - 1 , endDate + 1 );
75
+
75
76
List <InfrastructureScan > filteredForBAP = StringUtils .isEmpty (businessComponent ) ? Collections .EMPTY_LIST :
76
- infrastructureScans .stream ().filter (infrastructureScan -> infrastructureScan .getBusinessApplication ().equalsIgnoreCase (businessComponent )).collect (Collectors .toList ());
77
+ infrastructureScans .stream ().filter (infrastructureScan ->
78
+ businessComponent .equalsIgnoreCase (infrastructureScan .getBusinessApplication ())).collect (Collectors .toList ()
79
+ );
77
80
78
81
if (CollectionUtils .isNotEmpty (filteredForBAP )) {
79
82
List <InfrastructureScan > sortedDistinctForBAP = getSortedAndDistinctByInstanceId (filteredForBAP );
80
83
setInfraAudit (infrastructureAuditResponse , sortedDistinctForBAP , InfrastructureAuditStatus .INFRA_SCAN_BUSS_COMP_CRITICAL , InfrastructureAuditStatus .INFRA_SCAN_BUSS_COMP_HIGH , InfrastructureAuditStatus .INFRA_SCAN_BUSS_COMP_OK );
81
84
infrastructureAuditResponse .setInfrastructureScans (sortedDistinctForBAP );
82
85
} else {
83
86
infrastructureAuditResponse .addAuditStatus (InfrastructureAuditStatus .INFRA_SEC_SCAN_BUSS_COMP_NOT_FOUND );
87
+
84
88
List <InfrastructureScan > filteredForASV = StringUtils .isEmpty (businessService ) ? Collections .EMPTY_LIST :
85
- infrastructureScans .stream ().filter (infrastructureScan -> infrastructureScan .getBusinessService ().equalsIgnoreCase (businessService )).collect (Collectors .toList ());
89
+ infrastructureScans .stream ().filter (infrastructureScan -> businessService .equalsIgnoreCase (infrastructureScan .getBusinessService ())).collect (Collectors .toList ());
90
+
86
91
if (CollectionUtils .isNotEmpty (filteredForASV )) {
87
92
List <InfrastructureScan > sortedDistinctForASV = getSortedAndDistinctByInstanceId (filteredForASV );
88
93
setInfraAudit (infrastructureAuditResponse , sortedDistinctForASV , InfrastructureAuditStatus .INFRA_SEC_SCAN_BUSS_APP_CRITICAL , InfrastructureAuditStatus .INFRA_SEC_SCAN_BUSS_APP_HIGH , InfrastructureAuditStatus .INFRA_SEC_SCAN_BUSS_APP_OK );
0 commit comments