Skip to content

Commit

Permalink
fix #304 add scm import status and deleted fields to import items
Browse files Browse the repository at this point in the history
  • Loading branch information
gschueler committed Aug 11, 2020
1 parent 8535eba commit f036bf4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,16 @@
public class ScmImportItem implements DataOutput {
public String itemId;
public Boolean tracked;
public Boolean deleted;
public ScmJobItem job;
public String status;

public Map asMap() {
HashMap<String, Object> map = new HashMap<>();
map.put("itemId", itemId);
map.put("tracked", tracked);
map.put("deleted", deleted != null ? deleted : false);
map.put("status", status);
if(null!=job) {
map.put("job", job.toMap());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,12 @@ class SCMSpec extends Specification {
type: 'String'
)],
importItems: [
new ScmImportItem(itemId: '/a/path', tracked: false, job: null),
new ScmImportItem(itemId: '/a/path', tracked: false, job: null,deleted: false, status:'CLEAN'),
new ScmImportItem(
itemId: '/b/path',
tracked: true,
deleted: false,
status:'CLEAN',
job: new ScmJobItem(
jobId: 'ajob',
jobName: 'job name',
Expand All @@ -266,8 +268,8 @@ class SCMSpec extends Specification {
1 * out.output('Items:')
1 * out.output(
[
['itemId': '/a/path', 'tracked': false],
['itemId': '/b/path', 'tracked': true,
['itemId': '/a/path', 'tracked': false, 'deleted': false, status:'CLEAN'],
['itemId': '/b/path', 'tracked': true, 'deleted': false, status:'CLEAN',
'job' : [
'jobName' : 'job name',
'jobId' : 'ajob',
Expand Down

0 comments on commit f036bf4

Please sign in to comment.