How to mock private methods in when().thenReturn() statements in springbatch testing There is a private method in a springBatch Beans. configuration class.