I wrote this unit test: ```@WebMvcTest(CustomerController.class)
public class CustomerControllerTest {
@Autowired
private MockMvc mockMvc;
@Autowired
private CustomerService customerService;
@Test
void registerUser_validInput_returnsSuccess() throws Exception {
CustomerDto customerDto = new CustomerDto("m", "k", "[email protected]", "password", "borrower");
Mockito.doNothing().when(customerService).createCustomer(any(CustomerDto.class));
mockMvc.perform(post("/customer/register")
.contentType(MediaType.APPLICATION_JSON)
.content("{\"firstName\":\"m\",\"lastName\":\"k\",\"email\":\"email
@gmail.com","password":"password","role":"borrower"}"))
.andExpect(status().isOk())
.andExpect(content().string("Added a new customer"));
}
}
but I'm getting this error:Test ignored.
java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration by searching packages upwards from the test. You can use @ContextConfiguration, @SpringBootTest(classes=...) or other Spring Test supported mechanisms to explicitly declare the configuration classes to load. Classes annotated with @TestConfiguration are not considered.```