* Use java 11 * Use .of - Replace Arrays.asList with List.of - Replace HashSet<>(List.of()) with Set.of * Formatting
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user