@Override public Promise<PullResponse> pull( Path project, String refSpec, String remote, boolean rebase, Credentials credentials) { PullRequest pullRequest = dtoFactory .createDto(PullRequest.class) .withRemote(remote) .withRefSpec(refSpec) .withRebase(rebase); if (credentials != null) { pullRequest.setUsername(credentials.getUsername()); pullRequest.setPassword(credentials.getPassword()); } String url = getWsAgentBaseUrl() + PULL + "?projectPath=" + encodePath(project); return asyncRequestFactory .createPostRequest(url, pullRequest) .send(dtoUnmarshallerFactory.newUnmarshaller(PullResponse.class)); }