Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Jira authentication #232

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -77,7 +77,13 @@ private JSONObject userData(String name) {

@Override
public HostUser user(String username) {
throw new RuntimeException("needs authentication; not implemented yet");
var data = request.get("user")
.param("username", username)
.execute();
var user = new HostUser(data.get("name").asString(),
data.get("name").asString(),
data.get("displayName").asString());
return user;
}

@Override
@@ -45,6 +45,11 @@ void isMemberOfNegativeTests(TestInfo info) throws IOException {
void simple(TestInfo info) throws IOException {
try (var credentials = new HostCredentials(info)) {
var project = credentials.getIssueProject();

var userName = project.issueTracker().currentUser().id();
var user = project.issueTracker().user(userName);
assertEquals(userName, user.userName());

var issue = credentials.createIssue(project, "Test issue");
issue.setTitle("Updated title");
issue.setBody("This is now the body");