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

@ -23,16 +23,7 @@
package com.iluwatar.repository;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import javax.annotation.Resource;
import com.google.common.collect.Lists;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@ -40,7 +31,11 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import com.google.common.collect.Lists;
import javax.annotation.Resource;
import java.util.List;
import java.util.Optional;
import static org.junit.jupiter.api.Assertions.*;
/**
* Test case to test the functions of {@link PersonRepository}, beside the CRUD functions, the query
@ -59,7 +54,7 @@ public class AnnotationBasedRepositoryTest {
Person john = new Person("John", "lawrence", 35);
Person terry = new Person("Terry", "Law", 36);
List<Person> persons = Arrays.asList(peter, nasta, john, terry);
List<Person> persons = List.of(peter, nasta, john, terry);
/**
* Prepare data for test

View File

@ -23,16 +23,7 @@
package com.iluwatar.repository;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import javax.annotation.Resource;
import com.google.common.collect.Lists;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@ -40,7 +31,11 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import com.google.common.collect.Lists;
import javax.annotation.Resource;
import java.util.List;
import java.util.Optional;
import static org.junit.jupiter.api.Assertions.*;
/**
* Test case to test the functions of {@link PersonRepository}, beside the CRUD functions, the query
@ -58,7 +53,7 @@ public class RepositoryTest {
Person john = new Person("John", "lawrence", 35);
Person terry = new Person("Terry", "Law", 36);
List<Person> persons = Arrays.asList(peter, nasta, john, terry);
List<Person> persons = List.of(peter, nasta, john, terry);
/**
* Prepare data for test