Skip to content

Commit cb89812

Browse files
committed
Integration test: buscaPorEmail, finds no client.
Attempts to search for the client that matches the email and finds none. Returns 200.
1 parent 68249cb commit cb89812

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/test/java/com/sistemaclliente/ClienteControllerIntegrationTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,13 @@ public void buscaPorEmail_successFullPage_noParameters_returns200() throws Excep
636636
.andExpect(jsonPath("$.content[1].cpf").value("47852136582"))
637637
.andExpect(jsonPath("$.content.length()").value(2));
638638
}
639+
640+
@Test @DisplayName("Attempts to search for the client that matches the email and finds none. "
641+
+ "Returns 200.")
642+
public void buscaPorEmail_successEmptyPage_returns200() throws Exception{
643+
mvc.perform(get("/buscaemail?email=marcus@gmail.com")).andExpect(status().isOk())
644+
.andExpect(jsonPath("$.content.length()").value(0));
645+
}
639646

640647
}
641648

src/test/java/com/sistemaclliente/ClienteControllerTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,8 @@ public void buscaPorEmail_sucessoPaginaCheia_semParametros_retorno200() throws E
855855
verifyNoMoreInteractions(service);
856856
}
857857

858-
@Test
858+
@Test @DisplayName("Attempts to search for the client that matches the email and finds none. "
859+
+ "Returns 200.")
859860
public void buscaPorEmail_sucessoPaginaVazia_retorno200() throws Exception{
860861
List<ClienteResponseDTO> lista = List.of();
861862
Page<ClienteResponseDTO> page = new PageImpl<>(lista);

0 commit comments

Comments
 (0)