From ede2903d5e93c887cb2feed58f7fb5a5ab8fdd39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Ribardi=C3=A8re?= <4162940+ribardo0@users.noreply.github.com> Date: Sat, 25 Apr 2020 16:34:30 +0200 Subject: [PATCH] Include Project in RunnersAPI.getJobs* (Issue #552) (#553) * Include Project in RunnersAPI.getJobs* (Issue #552) * Fixing withAllowFailure and adding project to job.json Co-authored-by: Olivier RIBARDIERE --- .../java/org/gitlab4j/api/models/Job.java | 21 ++++++++++++++++++- src/test/resources/org/gitlab4j/api/job.json | 11 ++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/gitlab4j/api/models/Job.java b/src/main/java/org/gitlab4j/api/models/Job.java index 235417fb..42bf82b0 100644 --- a/src/main/java/org/gitlab4j/api/models/Job.java +++ b/src/main/java/org/gitlab4j/api/models/Job.java @@ -29,6 +29,7 @@ public class Job { private Boolean manual; private Boolean allowFailure; private Float duration; + private Project project; public Integer getId() { return id; @@ -205,6 +206,14 @@ public class Job { public void setDuration(Float duration) { this.duration = duration; } + + public Project getProject() { + return project; + } + + public void setProject(Project project) { + this.project = project; + } public Job withId(Integer id) { this.id = id; @@ -291,10 +300,20 @@ public class Job { return this; } - public Job allowFailureManual(Boolean allowFailure) { + public Job withAllowFailure(Boolean allowFailure) { this.allowFailure = allowFailure; return this; } + + public Job withDuration(Float duration) { + this.duration = duration; + return this; + } + + public Job withProject(Project project) { + this.project = project; + return this; + } @Override public String toString() { diff --git a/src/test/resources/org/gitlab4j/api/job.json b/src/test/resources/org/gitlab4j/api/job.json index c1e31b3d..492e4a6f 100644 --- a/src/test/resources/org/gitlab4j/api/job.json +++ b/src/test/resources/org/gitlab4j/api/job.json @@ -50,4 +50,15 @@ "web_url": "http://gitlab.dev/root", "website_url": "" } + , + "project": { + "id": 3, + "name": "Diaspora Project Site", + "description": "Project description", + "name_with_namespace": "Diaspora / Diaspora Project Site", + "path": "diaspora-project-site", + "path_with_namespace": "diaspora/diaspora-project-site", + "created_at": "2013-09-30T13:46:02Z" + + } } \ No newline at end of file -- GitLab