Use null instead of "N/A" as default change-number
Missing change.id is more clear to the consumer than interpreting a
string when change-number isn't available.
Solves: Jira GER-1698
Change-Id: Ic801fe799ba53d363306c443cb3e92993452ef65
diff --git a/src/main/java/com/googlesource/gerrit/plugins/eventseiffel/mapping/EiffelEventFactory.java b/src/main/java/com/googlesource/gerrit/plugins/eventseiffel/mapping/EiffelEventFactory.java
index ef3547c..df4f63c 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/eventseiffel/mapping/EiffelEventFactory.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/eventseiffel/mapping/EiffelEventFactory.java
@@ -193,7 +193,7 @@
.change(
EiffelChangeInfo.builder()
.details(commitUrl(repoName, commitSha1))
- .id(changeNbr != null ? String.valueOf(changeNbr) : "N/A")
+ .id(changeNbr != null ? String.valueOf(changeNbr) : null)
.tracker(GERRIT))
.meta(getMeta(epochMillisCreated));
parentEventIds.stream()
diff --git a/src/test/java/com/googlesource/gerrit/plugins/eventseiffel/mapping/EventMappingIT.java b/src/test/java/com/googlesource/gerrit/plugins/eventseiffel/mapping/EventMappingIT.java
index 575e1aa..ee2b553 100644
--- a/src/test/java/com/googlesource/gerrit/plugins/eventseiffel/mapping/EventMappingIT.java
+++ b/src/test/java/com/googlesource/gerrit/plugins/eventseiffel/mapping/EventMappingIT.java
@@ -102,7 +102,7 @@
assertPersonInfo(event.data.author, AUTHOR_NAME, AUTHOR_EMAIL, null);
assertGitIdentifier(
event.data.gitIdentifier, project.get(), "master", accountlessAuthor.getName());
- assertChangeInfo(event.data.change, "N/A", project.get(), accountlessAuthor.getName());
+ assertChangeInfo(event.data.change, null, project.get(), accountlessAuthor.getName());
assertSccMeta(event.meta, commitTimeInEpochMillis(accountlessAuthor));
assertSccLinks(event.links);
}
@@ -118,7 +118,7 @@
assertPersonInfo(event.data.author, admin.fullName(), admin.email(), admin.username());
assertGitIdentifier(
event.data.gitIdentifier, project.get(), "master", authorWithAccount.getName());
- assertChangeInfo(event.data.change, "N/A", project.get(), authorWithAccount.getName());
+ assertChangeInfo(event.data.change, null, project.get(), authorWithAccount.getName());
assertSccMeta(event.meta, commitTimeInEpochMillis(authorWithAccount));
assertSccLinks(event.links);
}