DeleteFileCallback implements Callback<Object> { @Override public void failure(RetrofitError error) { utils.logIssue("RetrofitError in DeleteFileCallback. File: [" + storedExceptionFileName + "]", error); } DeleteFileCallback(Context context, String storedExceptionFileName); @Override void success(Object o, Response response); @Override void failure(RetrofitError error);  }
@Test public void testFailureMethod() { DeleteFileCallback deleteFileCallback = new DeleteFileCallback(null, "unit_testing_file_name.txt"); RetrofitError error = mock(RetrofitError.class); Utils mockUtils = UnitTestUtils.mockUtils(); deleteFileCallback.utils = mockUtils; deleteFileCallback.failure(error); verify(mockUtils).logIssue(eq("RetrofitError in DeleteFileCallback. File: [unit_testing_file_name.txt]"), eq(error)); }