unit testing - How to partially mock 'equalsIgnoreCase' method of java.lang.String -


i using mockito/power mockito unit testing. want mock method 'equalsignorecase' in java.lang.string class.

other methods of java.lang.string should behave is, want mock 'equalsignorecase' method.

could please give example ?

rewrite while condition calls method. benefits in several ways:

  1. it's easy mock
  2. it won't throw exception if str1 null.
  3. it documents loop trying accomplish.

Comments