@@ -328,6 +328,28 @@ public void shouldCreateResetPasswordRequestWithSpecifiedClientId() throws Excep
328328 assertThat (response , is (nullValue ()));
329329 }
330330
331+ @ Test
332+ public void shouldCreateResetPasswordRequestWithSpecifiedClientIdWithOrganization () throws Exception {
333+ Request <Void > request = api .resetPassword ("CLIENT-ID" , "me@auth0.com" , "db-connection" , "ORGANIZATION-ID" );
334+ assertThat (request , is (notNullValue ()));
335+
336+ server .jsonResponse (AUTH_RESET_PASSWORD , 200 );
337+ Void response = request .execute ().getBody ();
338+ RecordedRequest recordedRequest = server .takeRequest ();
339+
340+ assertThat (recordedRequest , hasMethodAndPath (HttpMethod .POST , "/dbconnections/change_password" ));
341+ assertThat (recordedRequest , hasHeader ("Content-Type" , "application/json" ));
342+
343+ Map <String , Object > body = bodyFromRequest (recordedRequest );
344+ assertThat (body , hasEntry ("email" , "me@auth0.com" ));
345+ assertThat (body , hasEntry ("connection" , "db-connection" ));
346+ assertThat (body , hasEntry ("client_id" , "CLIENT-ID" ));
347+ assertThat (body , hasEntry ("organization" , "ORGANIZATION-ID" ));
348+ assertThat (body , not (hasKey ("password" )));
349+
350+ assertThat (response , is (nullValue ()));
351+ }
352+
331353 //Sign Up
332354
333355 @ SuppressWarnings ("deprecation" )
0 commit comments