Ao escreve a classe de teste ConsultaControllerTest, esta retornando os erros abaixo
Segue minha classe
package com.github.paulopcrp.healthcare.api.controller;
import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.web.servlet.MockMvc;
import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.security.config.http.MatcherType.mvc; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
@SpringBootTest @AutoConfigureMockMvc class ConsultaControllerTest {
@Test
@DisplayName("Deveria devolver codigo Http 400 quando informações inválidas.")
void agendar_cenario1() throws Exception {
var response = mvc.perform(post("/agendar"))
.andReturn().getResponse();
assertThat(response.getStatus()).isEqualTo(HttpStatus.BAD_REQUEST.value());
}
}