1. Project Clover database mar. janv. 20 2026 12:32:22 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 3 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  1 toggle @Test
25    public void shouldAcceptSvgAndUnrecognizedElement() {
26  1 verify((html) -> {
27  1 Element doc = JsoupUtils.createHtmlDocument(html);
28  1 String expected = doc.outerHtml();
29  1 return expected;
30    }, "html");
31   
32    }
33   
 
34  1 toggle @Test
35    public void shouldNotModifyVerbatimCode() {
36  1 verify((html) -> {
37  1 Element doc = JsoupUtils.createHtmlDocument(html);
38  1 String expected = doc.outerHtml();
39  1 return expected;
40    }, "html");
41   
42    }
43   
 
44  1 toggle @Test
45    public void shouldHasTextNode() {
46  1 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  1 assertFalse(JsoupUtils.hasTextNode(JsoupUtils.createHtmlDocument("<div><span></span></div>").body().firstChild()));
52    }
53   
54    }