You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2026/05/08 23:29:24 UTC
(ignite-teamcity-bot) branch master updated: test fix (#217)
This is an automated email from the ASF dual-hosted git repository.
dspavlov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git
The following commit(s) were added to refs/heads/master by this push:
new 0fa8fd17 test fix (#217)
0fa8fd17 is described below
commit 0fa8fd17f5539f72681dd9636dc1bc8796c3dce5
Author: ignitetcbot <43...@users.noreply.github.com>
AuthorDate: Sat May 9 02:29:18 2026 +0300
test fix (#217)
Co-authored-by: Dmitriy Pavlov <dp...@apache.org>
---
.../web/rest/monitoring/MonitoringServiceSecurityTest.java | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/web/rest/monitoring/MonitoringServiceSecurityTest.java b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/web/rest/monitoring/MonitoringServiceSecurityTest.java
index f9219381..9e9fcb4b 100644
--- a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/web/rest/monitoring/MonitoringServiceSecurityTest.java
+++ b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/web/rest/monitoring/MonitoringServiceSecurityTest.java
@@ -56,7 +56,7 @@ public class MonitoringServiceSecurityTest {
@Test
public void requestTimingFieldsAreEscaped() throws IOException {
- String html = new String(Files.readAllBytes(monitoringHtml()), StandardCharsets.UTF_8);
+ String html = readFile(monitoringHtml());
assertTrue(html.contains("escapeHtml(inv.method)"));
assertTrue(html.contains("escapeHtml(inv.path)"));
@@ -68,8 +68,8 @@ public class MonitoringServiceSecurityTest {
@Test
public void notificationTestControlsAreHiddenForNonAdmins() throws IOException, NoSuchMethodException {
- String html = new String(Files.readAllBytes(monitoringHtml()), StandardCharsets.UTF_8);
- String css = new String(Files.readAllBytes(styleCss()), StandardCharsets.UTF_8);
+ String html = readFile(monitoringHtml());
+ String css = readFile(styleCss());
assertTrue(html.contains("<div class=\"adminOnly\">"));
assertTrue(html.contains("testSlackNotification()"));
@@ -83,7 +83,7 @@ public class MonitoringServiceSecurityTest {
@Test
public void taskMonitoringBlockIsHiddenForNonAdmins() throws IOException {
- String html = new String(Files.readAllBytes(monitoringHtml()), StandardCharsets.UTF_8);
+ String html = readFile(monitoringHtml());
assertTrue(html.contains("<div class=\"adminOnly\">\n Tasks Monitoring Data:"));
assertTrue(html.contains("rest/monitoring/tasks"));
@@ -118,4 +118,10 @@ public class MonitoringServiceSecurityTest {
return Paths.get("ignite-tc-helper-web/src/main/webapp/css/style-1.5.css");
}
+
+ private static String readFile(Path path) throws IOException {
+ return new String(Files.readAllBytes(path), StandardCharsets.UTF_8)
+ .replace("\r\n", "\n")
+ .replace('\r', '\n');
+ }
}