mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-06 22:15:06 +00:00
* Use java 11 * Use .of - Replace Arrays.asList with List.of - Replace HashSet<>(List.of()) with Set.of * Formatting
This commit is contained in:
1 parent
dd971d8c19
commit
c8a481bb77
37 files changed
+176
-257
No files matched your search
+8
-10
@@ -97,11 +97,10 @@ public class MagicServiceImplTest {
|
||||
public void testFindWizardsWithSpellbook() throws Exception {
|
||||
final String bookname = "bookname";
|
||||
final Spellbook spellbook = mock(Spellbook.class);
|
||||
final Set<Wizard> wizards = new HashSet<>();
|
||||
wizards.add(mock(Wizard.class));
|
||||
wizards.add(mock(Wizard.class));
|
||||
wizards.add(mock(Wizard.class));
|
||||
|
||||
final Set<Wizard> wizards = Set.of(
|
||||
mock(Wizard.class),
|
||||
mock(Wizard.class),
|
||||
mock(Wizard.class));
|
||||
when(spellbook.getWizards()).thenReturn(wizards);
|
||||
|
||||
final SpellbookDao spellbookDao = mock(SpellbookDao.class);
|
||||
@@ -126,11 +125,10 @@ public class MagicServiceImplTest {
|
||||
|
||||
@Test
|
||||
public void testFindWizardsWithSpell() throws Exception {
|
||||
final Set<Wizard> wizards = new HashSet<>();
|
||||
wizards.add(mock(Wizard.class));
|
||||
wizards.add(mock(Wizard.class));
|
||||
wizards.add(mock(Wizard.class));
|
||||
|
||||
final Set<Wizard> wizards = Set.of(
|
||||
mock(Wizard.class),
|
||||
mock(Wizard.class),
|
||||
mock(Wizard.class));
|
||||
final Spellbook spellbook = mock(Spellbook.class);
|
||||
when(spellbook.getWizards()).thenReturn(wizards);
|
||||
|
||||
|
||||
Reference in new issue
Block a user