File tree Expand file tree Collapse file tree
main/java/ru/testit/services
test/java/ru/testit/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : local tests
2+ run-name : " #${{ github.run_number }} test by ${{ github.triggering_actor }}"
3+ on :
4+ pull_request :
5+ paths :
6+ - " testit-java-commons/**"
7+ - " build.gradle.kts"
8+ - " gradle.properties"
9+ - " settings.gradle.kts"
10+ - " .github/**/test.yml"
11+ env :
12+ JAVA_DISTRIBUTION : " temurin"
13+ JAVA_VERSION : 17
14+ jobs :
15+
16+ test-gradle :
17+ name : gradle testing
18+ runs-on : ubuntu-latest
19+
20+ steps :
21+ - name : Checkout adapters-java
22+ uses : actions/checkout@v4
23+
24+ - name : Setup java
25+ uses : actions/setup-java@v4
26+ with :
27+ distribution : ${{ env.JAVA_DISTRIBUTION }}
28+ java-package : jdk
29+ java-version : ${{ env.JAVA_VERSION }}
30+
31+ - name : Run tests
32+ run : |
33+ ./gradlew test
34+
Original file line number Diff line number Diff line change 1- version =2.9.0
1+ version =2.9.1
22
33org.gradle.daemon =true
44org.gradle.parallel =true
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ private HtmlEscapeUtils() {}
1515
1616 // Regex pattern to detect HTML tags
1717 private static final Pattern HTML_TAG_PATTERN = Pattern .compile (
18- "<\\ S.*?(?:>|/>) "
18+ "<\\ S.*[^>]*> "
1919 );
2020
2121 // Regex patterns to escape only non-escaped characters
Original file line number Diff line number Diff line change @@ -212,6 +212,19 @@ void testEscapeHtmlInObjectWithEmptyList() {
212212 Assertions .assertTrue (obj .tags .isEmpty ());
213213 }
214214
215+ @ Test
216+ void testEscapeHtmlInObjectWithSomeParameter () {
217+ // Test object with empty list
218+ TestObjectWithStringList obj = new TestObjectWithStringList ();
219+ obj .name = "Test <object href=\" \" >" ;
220+ obj .tags = new ArrayList <>(); // empty list
221+
222+ HtmlEscapeUtils .escapeHtmlInObject (obj );
223+
224+ Assertions .assertEquals ("Test <object href=\" \" >" , obj .name );
225+ Assertions .assertTrue (obj .tags .isEmpty ());
226+ }
227+
215228 @ Test
216229 void testEscapeHtmlInObjectWithNullList () {
217230 // Test object with null list
You can’t perform that action at this time.
0 commit comments