@@ -550,7 +550,7 @@ public void atualizarParcial_invalidName_returns400(String nome) throws Exceptio
550550
551551 @ ParameterizedTest @ NullAndEmptySource @ Transactional
552552 @ ValueSource (strings = {" " , "marcus@marcus@marcus" , "marcus.com" , "@marcus.com" , "marcus@" })
553- @ DisplayName ("It tries to update partial information of the client with an invalid email address and"
553+ @ DisplayName ("Attempts to update partial information of the client with an invalid email address and"
554554 + "returns 400." )
555555 public void atualizarParcial_invalidEmailAdress_returns400 (String email ) throws Exception {
556556 Cliente cliente1 = new Cliente ();
@@ -637,12 +637,20 @@ public void buscaPorEmail_successFullPage_noParameters_returns200() throws Excep
637637 .andExpect (jsonPath ("$.content.length()" ).value (2 ));
638638 }
639639
640- @ Test @ DisplayName ("Attempts to search for the client that matches the email and finds none. "
640+ @ Test @ DisplayName ("Attempts to search for a client that matches the email and finds none. "
641641 + "Returns 200." )
642642 public void buscaPorEmail_successEmptyPage_returns200 () throws Exception {
643643 mvc .perform (get ("/buscaemail?email=marcus@gmail.com" )).andExpect (status ().isOk ())
644644 .andExpect (jsonPath ("$.content.length()" ).value (0 ));
645645 }
646+
647+ @ ParameterizedTest @ NullSource @ DisplayName ("Attempts to find a client, but the email address doesn't"
648+ + "matches regex and returns 400." )
649+ @ ValueSource (strings = {"marcus@marcus@marcus" , "marcus.com" , "@marcus.com" , "marcus@" })
650+ public void buscaPorEmail_invalidEmailFormat_returns400 (String email ) throws Exception {
651+ mvc .perform (get ("/buscaemail" ).param ("email" , email )).andExpect (status ().isBadRequest ())
652+ .andExpect (content ().string (containsString ("inválido" )));
653+ }
646654
647655}
648656
0 commit comments