I\'m working a bit on an inherited code. I\'ve written a test that is supposed to catch NullPointerException (for it is trying to call a method from null object)
You can use PowerMock. First create mock of the class on which you are calling static methods -
mockStatic(BasketHelper.class);
Then define your stubs -
when(BasketHelper.getAction(request)).thenReturn(0); when(BasketHelper.getActionProduct(site, request)).thenReturn(product);