Skip to content

Commit

Permalink
Fix remaining unimplemented method
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Westberg committed Nov 5, 2019
1 parent 3411d75 commit 65c80d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 65c80d4

Please sign in to comment.