mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 16:58:56 +00:00
feature: added code refactoring changes for 2378 (#2379)
* fix:added code refactoring changes for 2378 * fix:added code refactoring changes for 2378 * build fix for 2378 * fix: updated pom.xml files for 2378 issue * fix:build fix for 2378 issue Co-authored-by: aparna <aparna@aparnas-MacBook-Air.local>
This commit is contained in:
@@ -38,7 +38,6 @@ import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import org.springframework.context.support.AbstractApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -62,7 +61,7 @@ public class CakeBakingServiceImpl implements CakeBakingService {
|
||||
var allToppings = getAvailableToppingEntities();
|
||||
var matchingToppings =
|
||||
allToppings.stream().filter(t -> t.getName().equals(cakeInfo.cakeToppingInfo.name))
|
||||
.collect(Collectors.toList());
|
||||
.toList();
|
||||
if (matchingToppings.isEmpty()) {
|
||||
throw new CakeBakingException(String.format("Topping %s is not available",
|
||||
cakeInfo.cakeToppingInfo.name));
|
||||
|
||||
Reference in New Issue
Block a user