1. Project Clover database mer. févr. 4 2026 12:48:28 CET
  2. Package org.devacfr.maven.skins.reflow

File JsoupUtilTest.java

 

Code metrics

0
10
3
1
54
31
3
0,3
3,33
3
1

Classes

Class Line # Actions
JsoupUtilTest 22 10 0% 3 0
1.0100%
 

Contributing tests

This file is covered by 6 tests. .

Source view

1    /*
2    * Copyright 2012-2025 Christophe Friederich
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10    * Unless required by applicable law or agreed to in writing, software
11    * distributed under the License is distributed on an "AS IS" BASIS,
12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    * See the License for the specific language governing permissions and
14    * limitations under the License.
15    */
16    package org.devacfr.maven.skins.reflow;
17   
18    import org.devacfr.testing.jupiter.TestCase;
19    import org.jsoup.nodes.Element;
20    import org.junit.jupiter.api.Test;
21   
 
22    public class JsoupUtilTest extends TestCase {
23   
 
24  2 toggle @Test
25    public void shouldAcceptSvgAndUnrecognizedElement() {
26  2 verify((html) -> {
27  2 Element doc = JsoupUtils.createHtmlDocument(html);
28  2 String expected = doc.outerHtml();
29  2 return expected;
30    }, "html");
31   
32    }
33   
 
34  2 toggle @Test
35    public void shouldNotModifyVerbatimCode() {
36  2 verify((html) -> {
37  2 Element doc = JsoupUtils.createHtmlDocument(html);
38  2 String expected = doc.outerHtml();
39  2 return expected;
40    }, "html");
41   
42    }
43   
 
44  2 toggle @Test
45    public void shouldHasTextNode() {
46  2 assertTrue(JsoupUtils.hasTextNode(JsoupUtils
47    .createHtmlDocument(
48    "<p><b>Type:</b> <span class=\"badge badge-info\">BADGE INFO</span> <code>element</code> .</p>")
49    .body()
50    .firstChild()));
51  2 assertFalse(JsoupUtils.hasTextNode(JsoupUtils.createHtmlDocument("<div><span></span></div>").body().firstChild()));
52    }
53   
54    }