v3.3.0 Added more pages to inspect

prototype
Yan 7 months ago
parent c0a0544923
commit 13436df52c

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>camel-springboot-activemq6-example</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
<name>camel-springboot-activemq6-example</name>
<properties>

@ -42,14 +42,32 @@ public class InspectionProcessor implements Processor {
@Value("${app.htmlunit.user-page-url}")
private String userPageUrl;
@Value("${app.htmlunit.vip1-page-url}")
private String vip1PageUrl;
@Value("${app.htmlunit.vip11-page-url}")
private String vip11PageUrl;
@Value("${app.htmlunit.vip2-page-url}")
private String vip2PageUrl;
@Value("${app.htmlunit.vip12-page-url}")
private String vip12PageUrl;
@Value("${app.htmlunit.vip3-page-url}")
private String vip3PageUrl;
@Value("${app.htmlunit.vip13-page-url}")
private String vip13PageUrl;
@Value("${app.htmlunit.vip21-page-url}")
private String vip21PageUrl;
@Value("${app.htmlunit.vip22-page-url}")
private String vip22PageUrl;
@Value("${app.htmlunit.vip23-page-url}")
private String vip23PageUrl;
@Value("${app.htmlunit.vip31-page-url}")
private String vip31PageUrl;
@Value("${app.htmlunit.vip32-page-url}")
private String vip32PageUrl;
@Value("${app.htmlunit.vip33-page-url}")
private String vip33PageUrl;
@Value("${app.htmlunit.logout-url}")
private String logoutUrl;
@ -82,12 +100,22 @@ public class InspectionProcessor implements Processor {
HtmlPage userPage = webClient.getPage(userPageUrl);
logger.debug("userPage hashcode: {}", userPage.hashCode());
Map<String, List<String>> reply1 = fillResponseMap(webClient, session, vip1PageUrl);
Map<String, List<String>> reply2 = fillResponseMap(webClient, session, vip2PageUrl);
Map<String, List<String>> reply3 = fillResponseMap(webClient, session, vip3PageUrl);
Map<String, List<String>> reply11 = fillResponseMap(webClient, session, vip11PageUrl);
Map<String, List<String>> reply12 = fillResponseMap(webClient, session, vip12PageUrl);
Map<String, List<String>> reply13 = fillResponseMap(webClient, session, vip13PageUrl);
Map<String, List<String>> reply21 = fillResponseMap(webClient, session, vip21PageUrl);
Map<String, List<String>> reply22 = fillResponseMap(webClient, session, vip22PageUrl);
Map<String, List<String>> reply23 = fillResponseMap(webClient, session, vip23PageUrl);
Map<String, List<String>> reply31 = fillResponseMap(webClient, session, vip31PageUrl);
Map<String, List<String>> reply32 = fillResponseMap(webClient, session, vip32PageUrl);
Map<String, List<String>> reply33 = fillResponseMap(webClient, session, vip33PageUrl);
webClient.getPage(logoutUrl);
exchange.getMessage().setBody(Map.of("vip1Page", reply1, "vip2Page", reply2, "vip3Page", reply3));
exchange.getMessage().setBody(Map.of("vip11Page", reply11, "vip12Page", reply12, "vip13Page", reply13,
"vip21Page", reply21, "vip22Page", reply22, "vip23Page", reply23,
"vip31Page", reply31, "vip32Page", reply32, "vip33Page", reply33));
} catch (Exception e) {
logger.error("LoginProcessor process error!", e);

@ -115,10 +115,10 @@ public class InspectionClient {
logger.info("entriesDiffering key: {}", entry.getKey());
logger.info("entriesDiffering expected: {}", entry.getValue().leftValue());
logger.info("entriesDiffering actual: {}", entry.getValue().rightValue());
contentBuilder.append(entry.getKey() + "\n");
contentBuilder.append("EXPECTED: " + entry.getValue().leftValue() + "\n");
contentBuilder.append("ACTUAL: " + entry.getValue().rightValue() + "\n");
contentBuilder.append("\n");
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");
});
return Pair.of(Boolean.TRUE, emailService.sendEmail(fromAddress, smtpPassword,
toAddresses, alertSubject, contentBuilder.toString()));

Loading…
Cancel
Save