@Test public void shouldInvokeResetPasswordEndpoint() throws Exception { Client client = new Client(); client.setId("client-id"); client.setClientId("client-id"); client.setRedirectUris(Collections.singletonList("http: User user = new User(); router.route().order(-1).handler(routingContext -> { routingContext.put("client", client); routingContext.put("user", user); routingContext.next(); }); when(userService.resetPassword(eq(client), eq(user), any())).thenReturn(Single.just(new ResetPasswordResponse())); testRequest( HttpMethod.POST, "/resetPassword?password=toto", null, resp -> { String location = resp.headers().get("location"); assertNotNull(location); assertTrue(location.endsWith("/resetPassword?success=reset_password_completed&client_id=client-id")); }, HttpStatusCode.FOUND_302, "Found", null); }
private void resetPassword(Client client, User user, io.gravitee.am.identityprovider.api.User principal, Handler<AsyncResult<ResetPasswordResponse>> handler) { userService.resetPassword(client, user, principal) .subscribe( response -> handler.handle(Future.succeededFuture(response)), error -> handler.handle(Future.failedFuture(error))); }
ResetPasswordSubmissionEndpoint extends UserRequestHandler { private void resetPassword(Client client, User user, io.gravitee.am.identityprovider.api.User principal, Handler<AsyncResult<ResetPasswordResponse>> handler) { userService.resetPassword(client, user, principal) .subscribe( response -> handler.handle(Future.succeededFuture(response)), error -> handler.handle(Future.failedFuture(error))); } }
ResetPasswordSubmissionEndpoint extends UserRequestHandler { private void resetPassword(Client client, User user, io.gravitee.am.identityprovider.api.User principal, Handler<AsyncResult<ResetPasswordResponse>> handler) { userService.resetPassword(client, user, principal) .subscribe( response -> handler.handle(Future.succeededFuture(response)), error -> handler.handle(Future.failedFuture(error))); } ResetPasswordSubmissionEndpoint(UserService userService); }
ResetPasswordSubmissionEndpoint extends UserRequestHandler { private void resetPassword(Client client, User user, io.gravitee.am.identityprovider.api.User principal, Handler<AsyncResult<ResetPasswordResponse>> handler) { userService.resetPassword(client, user, principal) .subscribe( response -> handler.handle(Future.succeededFuture(response)), error -> handler.handle(Future.failedFuture(error))); } ResetPasswordSubmissionEndpoint(UserService userService); @Override void handle(RoutingContext context); }
ResetPasswordSubmissionEndpoint extends UserRequestHandler { private void resetPassword(Client client, User user, io.gravitee.am.identityprovider.api.User principal, Handler<AsyncResult<ResetPasswordResponse>> handler) { userService.resetPassword(client, user, principal) .subscribe( response -> handler.handle(Future.succeededFuture(response)), error -> handler.handle(Future.failedFuture(error))); } ResetPasswordSubmissionEndpoint(UserService userService); @Override void handle(RoutingContext context);  }