0

I want to create one test class to test static method in below class.

    public class Drill{

    void doSomething(){
      drillStatic(con, prop, inp,fileName);
    }

    drillStatic(Connection con, Properties prop, String inp, String, fileName){

      //did something

     }       
}

May I know please how can I do it using PowerMock, Because I think Mock can't test static methods..!

I'm creating first time..!

Thanks

Trisha
  • 51
  • 1
  • 7
  • 1
    Possible duplicate of [How to mock static method without powermock](https://stackoverflow.com/questions/44967108/how-to-mock-static-method-without-powermock) – Adi Ohana Apr 02 '19 at 15:18
  • Possible duplicate of [PowerMockito mock single static method and return object](https://stackoverflow.com/questions/10583202/powermockito-mock-single-static-method-and-return-object) – Madhu Bhat Apr 02 '19 at 15:21
  • @AdiOhana that post is about mocking without Powermock, but OP wants to test using Powermock – Madhu Bhat Apr 02 '19 at 15:22
  • **1)** Mocks don't test methods (static or otherwise), they simulate behavior. **2)** Which is the static method that you want to test and how does your test case look so far? Sharing a [sscce](http://sscce.org) will greatly improve the chances of getting a quick and complete response. – Morfic Apr 08 '19 at 15:30

0 Answers0