BranchNotificationMessageBuilderSlack { public Message getUpdatedMessage(String channel, String threadTs, String pr, List<String> sourceStrings) { Message message = getBaseMessage(channel, pr, sourceStrings, "Your branch was updated with new strings! Please *add screenshots* as soon as possible and *wait for translations* before releasing."); message.setThreadTs(threadTs); return message; }  Message getNewMessage(String channel, String pr, List<String> sourceStrings); Message getUpdatedMessage(String channel, String threadTs, String pr, List<String> sourceStrings); Message getTranslatedMessage(String channel, String threadTs); Message getScreenshotMissingMessage(String channel, String threadTs);  }
@Test public void testGetUpdatedMessage() { Message newMessage = branchNotificationMessageBuilderSlack.getUpdatedMessage("channel-test", "pr-test", "ts-test", Arrays.asList("string1", "string2")); String json = objectMapper.writeValueAsStringUnchecked(newMessage); assertEquals("{\"channel\":\"channel-test\",\"text\":null,\"attachments\":[{\"title\":null,\"text\":\"Y" + "our branch was updated with new strings! Please *add screenshots* as soon as possible and *wait for tra" + "nslations* before releasing.\",\"fallback\":null,\"color\":\"good\",\"actions\":[{\"type\":\"button\",\"" + "text\":\"Screenshots\",\"url\":\"http: "style\":\"primary\"}],\"fields\":[{\"title\":\"PR\",\"value\":\"ts-test\",\"short\":true},{\"title\":\"" + "String number\",\"value\":\"2\",\"short\":true},{\"title\":\"Strings\",\"value\":\"string1, string2\",\"" + "short\":null}],\"mrkdwn_in\":[\"text\",\"pretex\",\"fields\"]}],\"thread_ts\":\"pr-test\"}", json); }