Skip to content

Commit

Permalink
feat(plugins): Add description and provider to PluginRelease (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsie committed Jun 22, 2020
1 parent 5c80fdc commit bf7cdac
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
public class PluginInfo {

final String id;
final String description;
final String provider;
final List<Release> releases;

public PluginInfo(String id, List<Release> releases) {
public PluginInfo(String id, String description, String provider, List<Release> releases) {
this.id = id;
this.description = description;
this.provider = provider;
this.releases = releases;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ private List<PluginRelease> getPluginReleases() {
release ->
new PluginRelease(
info.id,
info.description,
info.provider,
release.version,
release.date,
release.requires,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

public class PluginRelease {
private final String pluginId;
private final String description;
private final String provider;
private final String version;
private final String releaseDate;
private final String requires;
Expand All @@ -31,6 +33,8 @@ public class PluginRelease {

public PluginRelease(
String pluginId,
String description,
String provider,
String version,
String releaseDate,
String requires,
Expand All @@ -40,6 +44,8 @@ public PluginRelease(
boolean preferred,
String lastModified) {
this.pluginId = pluginId;
this.description = description;
this.provider = provider;
this.version = version;
this.releaseDate = releaseDate;
this.requires = requires;
Expand All @@ -54,6 +60,14 @@ public String getPluginId() {
return pluginId;
}

public String getDescription() {
return description;
}

public String getProvider() {
return provider;
}

public String getVersion() {
return version;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class PluginReleaseServiceSpec extends Specification {
@Unroll
def "gets releases since timestamp"() {
given:
PluginInfo plugin1 = new PluginInfo("plugin1", [
release("1.0.0", clock.instant()),
release("1.0.1", clock.instant().plus(1, ChronoUnit.DAYS))
PluginInfo plugin1 = new PluginInfo("plugin1", "A pugin", "foo@example.com", [
release("1.0.0", clock.instant()),
release("1.0.1", clock.instant().plus(1, ChronoUnit.DAYS))
])
PluginInfo plugin2 = new PluginInfo("plugin2", [
release("2.0.0", clock.instant().plus(2, ChronoUnit.DAYS))
PluginInfo plugin2 = new PluginInfo("plugin2", "A pugin", "foo@example.com", [
release("2.0.0", clock.instant().plus(2, ChronoUnit.DAYS))
])

and:
Expand Down

0 comments on commit bf7cdac

Please sign in to comment.