Add java 11 support for #987 (o-t) (#1051)

* Use java 11

* Use .of
- Replace Arrays.asList with List.of
- Replace HashSet<>(List.of()) with Set.of

* Formatting
This commit is contained in:
Leon Mak
2019-10-29 14:37:40 +08:00
committed by Ilkka Seppälä
parent dd971d8c19
commit c8a481bb77
37 changed files with 176 additions and 257 deletions

View File

@ -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);