Reputation: 5758
I am using Mockito/Power Mockito for unit testing. I want to mock the method 'equalsIgnoreCase' in java.lang.String class.
Other methods of java.lang.String should behave as it is, I want to mock only 'equalsIgnoreCase' method.
Could anyone please give an example for this ?
Upvotes: 1
Views: 943
Reputation: 299
Rewrite your while
condition so that it calls a method. This benefits you in several ways:
str1
is null.Upvotes: 3