Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notify: rename SlackUpdater to SlackNotifier #649

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -39,5 +39,5 @@
org.openjdk.skara.bots.notify.issue.IssueUpdaterFactory,
org.openjdk.skara.bots.notify.json.JsonNotifierFactory,
org.openjdk.skara.bots.notify.mailinglist.MailingListNotifierFactory,
org.openjdk.skara.bots.notify.slack.SlackUpdaterFactory;
org.openjdk.skara.bots.notify.slack.SlackNotifierFactory;
}
@@ -35,12 +35,12 @@
import java.util.List;
import java.time.format.DateTimeFormatter;

public class SlackUpdater implements RepositoryUpdateConsumer, PullRequestUpdateConsumer {
class SlackNotifier implements RepositoryUpdateConsumer, PullRequestUpdateConsumer {
private final RestRequest prWebhook;
private final RestRequest commitWebhook;
private final String username;

public SlackUpdater(URI prWebhook, URI commitWebhook, String username) {
SlackNotifier(URI prWebhook, URI commitWebhook, String username) {
this.prWebhook = prWebhook != null ? new RestRequest(prWebhook) : null;
this.commitWebhook = commitWebhook != null ? new RestRequest(commitWebhook) : null;
this.username = username;
@@ -29,7 +29,7 @@

import java.net.URI;

public class SlackUpdaterFactory implements NotifierFactory {
public class SlackNotifierFactory implements NotifierFactory {
@Override
public String name() {
return "slack";
@@ -46,7 +46,6 @@ public Notifier create(BotConfiguration botConfiguration, JSONObject notifierCon
commitWebhook = URIBuilder.base(notifierConfiguration.get("commit").asString()).build();
}
var username = notifierConfiguration.get("username").asString();
var updater = new SlackUpdater(prWebhook, commitWebhook, username);
return updater;
return new SlackNotifier(prWebhook, commitWebhook, username);
}
}