Have an observation on the following code snippet:

RegistrationControllerTest.java

//import statements

@RunWith(SpringRunner.class)

public class RegistrationControllerTest
{
@MockBean
private CustomerRepository customerRepository;
@MockBean
private CustomerService customerService;//Mockito.mock(CustomerService.class); set constr
@InjectMocks
private RegistrationController registrationController;
@Autowired
private MockMvc mockMvc;
@Test
public void testMethod()
{
//unit testing logic
}
}

What will happen when the given test case is subjected to execution?

 Test case execution will succeed without any errors or failures.
 Test case execution will encounter a failure because MockMvc cannot get autowired successfully
 Test case cannot be subjected to execution due to an unresolved compilation error caused by MockMvc
 Test case execution will encounter an error because MockMvc cannot get autowired successfully
Verified Answer
Correct Option - d

To get all Infosys Certified SCM Microservice with Springboot Professional Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram