@@ -60,11 +60,11 @@ public void givenUserService_whenAddSpecificUser_thenOK() {
6060
6161 //============= anyX
6262 @ Test
63- public void givenUserService_whenSearchForUserByFirstName_thenFound () {
64- expect (userService .findByFirstName (anyString ())).andReturn (Collections .emptyList ());
63+ public void givenUserService_whenSearchForUserByEmail_thenFound () {
64+ expect (userService .findByEmail (anyString ())).andReturn (Collections .emptyList ());
6565 replay (userService );
6666
67- List <User > result = userService .findByFirstName ( "joe " );
67+ List <User > result = userService .findByEmail ( "test@example.com " );
6868 verify (userService );
6969 assertEquals (0 ,result .size ());
7070 }
@@ -191,21 +191,21 @@ public void givenUserService_whenSearchForUserByEmailNotEndsWith_thenFound() {
191191 //================ custom matcher
192192
193193 @ Test
194- public void givenUserService_whenSearchForUserByLastName_thenFound () {
195- expect (userService .findByLastName ( charCount ( 3 ))).andReturn (Collections .emptyList ());
194+ public void givenUserService_whenSearchForUserByEmailCharCount_thenFound () {
195+ expect (userService .findByEmail ( minCharCount ( 5 ))).andReturn (Collections .emptyList ());
196196 replay (userService );
197197
198- List <User > result = userService .findByLastName ( "doe " );
198+ List <User > result = userService .findByEmail ( "test@example.com " );
199199 verify (userService );
200200 assertEquals (0 ,result .size ());
201201 }
202202
203- public static String charCount (int value ){
203+ public static String minCharCount (int value ){
204204 EasyMock .reportMatcher (new IArgumentMatcher () {
205205 @ Override
206206 public boolean matches (Object argument ) {
207207 return argument instanceof String
208- && ((String ) argument ).length () = = value ;
208+ && ((String ) argument ).length () > = value ;
209209 }
210210
211211 @ Override
0 commit comments