Skip to content

Commit

Permalink
fix the logic that marks distributionSet as complete (eclipse-hawkbit…
Browse files Browse the repository at this point in the history
…#838)

DistributionSets without SoftwareModules shall not be marked as complete, when no Software Module is assigned

Signed-off-by: Ravindranath Sandeep (INST-IOT/ESW-Imb) <Sandeep.Ravindranath@bosch-si.com>
  • Loading branch information
smy4kor authored and stefbehl committed Jul 1, 2019
1 parent 4b88500 commit c8f0f9a
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -209,8 +210,12 @@ public void setKey(final String key) {

@Override
public boolean checkComplete(final DistributionSet distributionSet) {
return distributionSet.getModules().stream().map(SoftwareModule::getType).collect(Collectors.toList())
.containsAll(getMandatoryModuleTypes());
List<SoftwareModuleType> smTypes = distributionSet.getModules().stream().map(SoftwareModule::getType)
.collect(Collectors.toList());
if (smTypes.isEmpty()) {
return false;
}
return smTypes.containsAll(getMandatoryModuleTypes());
}

@Override
Expand Down

0 comments on commit c8f0f9a

Please sign in to comment.