Home » JAVA Programming » Java Basic » Question
  1. How to let junits know that they need to be run using PowerMock?
    1. @RunWith(Junits)
    2. @RunWith(PowerMockRunner.class)
    3. @RunWith(PowerMock)
    4. @PowerMock
    5. None of these
Correct Option: A

@RunWith(PowerMockRunner.class) signifies to use PowerMock JUnit runner. Along with that @PrepareForTest(User.class) is used to declare the class being tested. mockStatic(Resource.class) is used to mock the static methods.



Your comments will be displayed only after manual approval.