@@ -31,55 +31,54 @@ public class EmployeeSpringFunctionalIntegrationTest {
3131
3232 @ Test
3333 public void givenEmployeeId_whenGetEmployeeById_thenCorrectEmployee () {
34- WebTestClient client = WebTestClient
35- .bindToRouterFunction (config .getEmployeeByIdRoute ())
36- .build ();
34+ WebTestClient client = WebTestClient .bindToRouterFunction (config .getEmployeeByIdRoute ())
35+ .build ();
3736
3837 Employee employee = new Employee ("1" , "Employee 1" );
3938
4039 given (employeeRepository .findEmployeeById ("1" )).willReturn (Mono .just (employee ));
4140
4241 client .get ()
43- .uri ("/employees/1" )
44- .exchange ()
45- .expectStatus ().isOk ()
46- .expectBody (Employee .class ).isEqualTo (employee );
42+ .uri ("/employees/1" )
43+ .exchange ()
44+ .expectStatus ()
45+ .isOk ()
46+ .expectBody (Employee .class )
47+ .isEqualTo (employee );
4748 }
4849
4950 @ Test
5051 public void whenGetAllEmployees_thenCorrectEmployees () {
51- WebTestClient client = WebTestClient
52- .bindToRouterFunction (config .getAllEmployeesRoute ())
53- .build ();
52+ WebTestClient client = WebTestClient .bindToRouterFunction (config .getAllEmployeesRoute ())
53+ .build ();
5454
55- List <Employee > employees = Arrays .asList (
56- new Employee ("1" , "Employee 1" ),
57- new Employee ("2" , "Employee 2" )
58- );
55+ List <Employee > employees = Arrays .asList (new Employee ("1" , "Employee 1" ), new Employee ("2" , "Employee 2" ));
5956
6057 Flux <Employee > employeeFlux = Flux .fromIterable (employees );
6158 given (employeeRepository .findAllEmployees ()).willReturn (employeeFlux );
6259
6360 client .get ()
64- .uri ("/employees" )
65- .exchange ()
66- .expectStatus ().isOk ()
67- .expectBodyList (Employee .class ).isEqualTo (employees );
61+ .uri ("/employees" )
62+ .exchange ()
63+ .expectStatus ()
64+ .isOk ()
65+ .expectBodyList (Employee .class )
66+ .isEqualTo (employees );
6867 }
6968
7069 @ Test
7170 public void whenUpdateEmployee_thenEmployeeUpdated () {
72- WebTestClient client = WebTestClient
73- .bindToRouterFunction (config .updateEmployeeRoute ())
74- .build ();
71+ WebTestClient client = WebTestClient .bindToRouterFunction (config .updateEmployeeRoute ())
72+ .build ();
7573
7674 Employee employee = new Employee ("1" , "Employee 1 Updated" );
7775
7876 client .post ()
79- .uri ("/employees/update" )
80- .body (Mono .just (employee ), Employee .class )
81- .exchange ()
82- .expectStatus ().isOk ();
77+ .uri ("/employees/update" )
78+ .body (Mono .just (employee ), Employee .class )
79+ .exchange ()
80+ .expectStatus ()
81+ .isOk ();
8382
8483 verify (employeeRepository ).updateEmployee (employee );
8584 }
0 commit comments