Added tests for withCredentials.