Out of the following two test cases in BundleProcessorTest.java, i am getting below exception, although, my first test case passes successfully.
Ideally anyString() should not be used outside the mock or verify block.I was facing the same issue.Changing the anyString() to some string ("xyz") value works fine.
Note : Make a note that you might use anyString() to some other methods that leads in failure of some other method. It wasted my one hour to figure it out. My actual test method was getting passes individually but when i was trying to run that in a hole it was getting failed because of the reason that some other test case was using anyString() outside to mock or verify block.