diff --git a/spring-5-reactive-security/pom.xml b/spring-5-reactive-security/pom.xml index 2f4a31241b..58c993bda5 100644 --- a/spring-5-reactive-security/pom.xml +++ b/spring-5-reactive-security/pom.xml @@ -128,7 +128,7 @@ 1.0 4.1 3.1.6.RELEASE - 2.2.1.RELEASE + 2.2.2.RELEASE diff --git a/spring-5-reactive-security/src/test/java/com/baeldung/reactive/functional/EmployeeSpringFunctionalIntegrationTest.java b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/functional/EmployeeSpringFunctionalIntegrationTest.java index 6e73e8072c..d8e2f0b23b 100644 --- a/spring-5-reactive-security/src/test/java/com/baeldung/reactive/functional/EmployeeSpringFunctionalIntegrationTest.java +++ b/spring-5-reactive-security/src/test/java/com/baeldung/reactive/functional/EmployeeSpringFunctionalIntegrationTest.java @@ -1,11 +1,7 @@ package com.baeldung.reactive.functional; -import static org.mockito.BDDMockito.given; -import static org.mockito.Mockito.verify; - -import java.util.ArrayList; -import java.util.List; - +import com.baeldung.webflux.Employee; +import com.baeldung.webflux.EmployeeRepository; import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.runner.RunWith; @@ -15,13 +11,15 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.reactive.server.WebTestClient; - -import com.baeldung.webflux.Employee; -import com.baeldung.webflux.EmployeeRepository; - import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; +import java.util.Arrays; +import java.util.List; + +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.verify; + @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = EmployeeSpringFunctionalApplication.class) @FixMethodOrder(MethodSorters.NAME_ASCENDING) @@ -58,15 +56,11 @@ public class EmployeeSpringFunctionalIntegrationTest { .bindToRouterFunction(config.getAllEmployeesRoute()) .build(); - List employeeList = new ArrayList<>(); + List employees = Arrays.asList( + new Employee("1", "Employee 1"), + new Employee("2", "Employee 2")); - Employee employee1 = new Employee("1", "Employee 1"); - Employee employee2 = new Employee("2", "Employee 2"); - - employeeList.add(employee1); - employeeList.add(employee2); - - Flux employeeFlux = Flux.fromIterable(employeeList); + Flux employeeFlux = Flux.fromIterable(employees); given(employeeRepository.findAllEmployees()).willReturn(employeeFlux); client.get() @@ -75,7 +69,7 @@ public class EmployeeSpringFunctionalIntegrationTest { .expectStatus() .isOk() .expectBodyList(Employee.class) - .isEqualTo(employeeList); + .isEqualTo(employees); } @Test