|
|
|
|
@ -9,6 +9,7 @@ import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
|
|
|
|
import org.htmlunit.WebClient;
|
|
|
|
|
import org.htmlunit.html.HtmlButton;
|
|
|
|
|
@ -92,7 +93,7 @@ public class CaptureService {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ObjectMapper objectMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private SlackService slackService;
|
|
|
|
|
|
|
|
|
|
@ -126,15 +127,12 @@ public class CaptureService {
|
|
|
|
|
logger.info("entriesDiffering key: {}", entry.getKey());
|
|
|
|
|
logger.info("entriesDiffering expected: {}", entry.getValue().leftValue());
|
|
|
|
|
logger.info("entriesDiffering actual: {}", entry.getValue().rightValue());
|
|
|
|
|
contentBuilder.append(entry.getKey() + "<br/>\n");
|
|
|
|
|
contentBuilder.append("EXPECTED: " + entry.getValue().leftValue() + "<br/>\n");
|
|
|
|
|
contentBuilder.append("ACTUAL: " + entry.getValue().rightValue() + "<br/>\n");
|
|
|
|
|
contentBuilder.append("<br/>\n");
|
|
|
|
|
contentBuilder.append(entry.getKey() + "<br/>\n" + entry.getValue().rightValue() + "<br/>\n");
|
|
|
|
|
});
|
|
|
|
|
Pair<Boolean, Boolean> sendEmailResult = Pair.of(Boolean.TRUE, emailService.sendEmail(fromAddress,
|
|
|
|
|
smtpPassword, toAddresses, alertSubject, contentBuilder.toString()));
|
|
|
|
|
logger.info("sendEmailResult: {}", sendEmailResult);
|
|
|
|
|
if (sendEmailResult.equals(Pair.of(Boolean.TRUE,Boolean.TRUE))) {
|
|
|
|
|
if (StringUtils.isNotEmpty(contentBuilder.toString())) {
|
|
|
|
|
slackService.sendMessage(contentBuilder.toString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|