|
14 | 14 | public class MyUserLiveTest { |
15 | 15 |
|
16 | 16 | private final MyUser userJohn = new MyUser("john", "doe", "john@doe.com", 11); |
17 | | - |
| 17 | + private String URL_PREFIX = "http://localhost:8082/spring-security-rest-full/auth/api/myusers"; |
18 | 18 | @Test |
19 | 19 | public void whenGettingListOfUsers_thenCorrect() { |
20 | | - final Response response = givenAuth().get("http://localhost:8080/auth/api/myusers"); |
| 20 | + final Response response = givenAuth().get(URL_PREFIX); |
21 | 21 | final MyUser[] result = response.as(MyUser[].class); |
22 | 22 | assertEquals(result.length, 2); |
23 | 23 | } |
24 | 24 |
|
25 | 25 | @Test |
26 | 26 | public void givenFirstName_whenGettingListOfUsers_thenCorrect() { |
27 | | - final Response response = givenAuth().get("http://localhost:8080/auth/api/myusers?firstName=john"); |
| 27 | + final Response response = givenAuth().get(URL_PREFIX + "?firstName=john"); |
28 | 28 | final MyUser[] result = response.as(MyUser[].class); |
29 | 29 | assertEquals(result.length, 1); |
30 | 30 | assertEquals(result[0].getEmail(), userJohn.getEmail()); |
31 | 31 | } |
32 | 32 |
|
33 | 33 | @Test |
34 | 34 | public void givenPartialLastName_whenGettingListOfUsers_thenCorrect() { |
35 | | - final Response response = givenAuth().get("http://localhost:8080/auth/api/myusers?lastName=do"); |
| 35 | + final Response response = givenAuth().get(URL_PREFIX + "?lastName=do"); |
36 | 36 | final MyUser[] result = response.as(MyUser[].class); |
37 | 37 | assertEquals(result.length, 2); |
38 | 38 | } |
39 | 39 |
|
40 | 40 | @Test |
41 | 41 | public void givenEmail_whenGettingListOfUsers_thenIgnored() { |
42 | | - final Response response = givenAuth().get("http://localhost:8080/auth/api/myusers?email=john"); |
| 42 | + final Response response = givenAuth().get(URL_PREFIX + "?email=john"); |
43 | 43 | final MyUser[] result = response.as(MyUser[].class); |
44 | 44 | assertEquals(result.length, 2); |
45 | 45 | } |
|
0 commit comments