diff --git a/src/main/java/com/redhat/constants/Constants.java b/src/main/java/com/redhat/constants/Constants.java index 83a8c2a..947089f 100644 --- a/src/main/java/com/redhat/constants/Constants.java +++ b/src/main/java/com/redhat/constants/Constants.java @@ -34,4 +34,7 @@ public class Constants { "https://github.com/m-czernek/acrobot \n\n" + "Currently, Acrobot is testing injecting IRC acronym database into the results. For feedback, comments, or suggestions "+ "about the function, visit https://github.com/m-czernek/acrobot/pull/12"; + + public static final String FOUND_YAML_TEXT = "\n_Found requested acronym in the IRC database. " + + "Send @Acrobot help for more information about this feature._\n"; } diff --git a/src/main/java/com/redhat/messages/YamlAcrobotInjector.java b/src/main/java/com/redhat/messages/YamlAcrobotInjector.java index 1f6b562..36a362a 100644 --- a/src/main/java/com/redhat/messages/YamlAcrobotInjector.java +++ b/src/main/java/com/redhat/messages/YamlAcrobotInjector.java @@ -1,6 +1,7 @@ package com.redhat.messages; import com.fasterxml.jackson.databind.JsonNode; +import com.redhat.constants.Constants; import com.redhat.entities.Acronym; import com.redhat.entities.Explanation; import com.redhat.persistence.YamlDal; @@ -9,9 +10,9 @@ public class YamlAcrobotInjector { private YamlDal dal = new YamlDal(); - String res = "\n_Found requested acronym in the IRC database. Send @Acrobot help for more information about this feature._\n"; public String injectYamlAcronyms(JsonNode eventJson, String originalMessage) { + String res = Constants.FOUND_YAML_TEXT; String requestedAcronym = eventJson.get("message").get("argumentText").asText().trim(); Set yamlAcronyms = dal.getAcronymsByName(requestedAcronym); diff --git a/src/main/java/com/redhat/persistence/YamlDal.java b/src/main/java/com/redhat/persistence/YamlDal.java index 4987e33..f4bbc2c 100644 --- a/src/main/java/com/redhat/persistence/YamlDal.java +++ b/src/main/java/com/redhat/persistence/YamlDal.java @@ -16,7 +16,7 @@ import java.util.Set; public class YamlDal { - Map> yamlDatabase; + private Map> yamlDatabase; public YamlDal() {