| 1 |  |  | 
 
| 2 |  |  | 
 
| 3 |  |  | 
 
| 4 |  |  | 
 
| 5 |  |  | 
 
| 6 |  |  | 
 
| 7 |  |  | 
 
| 8 |  |  | 
 
| 9 |  |  | 
 
| 10 |  |  | 
 
| 11 |  |  | 
 
| 12 |  |  | 
 
| 13 |  |  | 
 
| 14 |  |  | 
 
| 15 |  |  | 
 
| 16 |  |  | 
 
| 17 |  |  | 
 
| 18 |  |  | 
 
| 19 |  | package org.devacfr.maven.skins.reflow.snippet; | 
 
| 20 |  |  | 
 
| 21 |  | import java.io.IOException; | 
 
| 22 |  |  | 
 
| 23 |  | import org.devacfr.maven.skins.reflow.ISkinConfig; | 
 
| 24 |  | import org.devacfr.testing.jupiter.MockitoTestCase; | 
 
| 25 |  | import org.junit.jupiter.api.Test; | 
 
| 26 |  | import org.mockito.Mock; | 
 
| 27 |  |  | 
|  |  | 
            
                |  | 81,2% | Uncovered Elements: 6 (32) | Complexity: 13 | Complexity Density: 0,52 |  | 
| 28 |  | public class SnippetParserTest extends MockitoTestCase { | 
 
| 29 |  |  | 
 
| 30 |  | @Mock | 
 
| 31 |  | private ISkinConfig config; | 
 
| 32 |  |  | 
|  |  | 
            
                |  | 75% | Uncovered Elements: 1 (4) | Complexity: 2 | Complexity Density: 0,5 | 1PASS |  | 
| 33 | 1 |  @Test... | 
 
| 34 |  | public void shouldReplaceSnippetByHtml() throws Exception { | 
 
| 35 | 1 | verify((htmlSource) -> { | 
 
| 36 | 1 | try { | 
 
| 37 | 1 | return createParser().parse(config, htmlSource).html(); | 
 
| 38 |  | } catch (final IOException e) { | 
 
| 39 | 0 | throw new RuntimeException(e.getMessage(), e); | 
 
| 40 |  | } | 
 
| 41 |  | }, "html"); | 
 
| 42 |  | } | 
 
| 43 |  |  | 
|  |  | 
            
                |  | 75% | Uncovered Elements: 1 (4) | Complexity: 2 | Complexity Density: 0,5 | 1PASS |  | 
| 44 | 1 |  @Test... | 
 
| 45 |  | public void shouldRenderCard() { | 
 
| 46 | 1 | verify((htmlSource) -> { | 
 
| 47 | 1 | try { | 
 
| 48 | 1 | return createParser().parse(config, htmlSource).html(); | 
 
| 49 |  | } catch (final IOException e) { | 
 
| 50 | 0 | throw new RuntimeException(e.getMessage(), e); | 
 
| 51 |  | } | 
 
| 52 |  | }, "html"); | 
 
| 53 |  | } | 
 
| 54 |  |  | 
|  |  | 
            
                |  | 75% | Uncovered Elements: 1 (4) | Complexity: 2 | Complexity Density: 0,5 | 1PASS |  | 
| 55 | 1 |  @Test... | 
 
| 56 |  | public void shouldRenderCardRecursively() { | 
 
| 57 | 1 | verify((htmlSource) -> { | 
 
| 58 | 1 | try { | 
 
| 59 | 1 | return createParser().parse(config, htmlSource).html(); | 
 
| 60 |  | } catch (final IOException e) { | 
 
| 61 | 0 | throw new RuntimeException(e.getMessage(), e); | 
 
| 62 |  | } | 
 
| 63 |  | }, "html"); | 
 
| 64 |  | } | 
 
| 65 |  |  | 
|  |  | 
            
                |  | 75% | Uncovered Elements: 1 (4) | Complexity: 2 | Complexity Density: 0,5 | 1PASS |  | 
| 66 | 1 |  @Test... | 
 
| 67 |  | public void shouldRenderBadge() { | 
 
| 68 | 1 | verify((htmlSource) -> { | 
 
| 69 | 1 | try { | 
 
| 70 | 1 | return createParser().parse(config, htmlSource).html(); | 
 
| 71 |  | } catch (final IOException e) { | 
 
| 72 | 0 | throw new RuntimeException(e.getMessage(), e); | 
 
| 73 |  | } | 
 
| 74 |  | }, "html"); | 
 
| 75 |  | } | 
 
| 76 |  |  | 
|  |  | 
            
                |  | 75% | Uncovered Elements: 1 (4) | Complexity: 2 | Complexity Density: 0,5 | 1PASS |  | 
| 77 | 1 |  @Test... | 
 
| 78 |  | public void shouldRenderLayout() { | 
 
| 79 | 1 | verify((htmlSource) -> { | 
 
| 80 | 1 | try { | 
 
| 81 | 1 | return createParser().parse(config, htmlSource).html(); | 
 
| 82 |  | } catch (final IOException e) { | 
 
| 83 | 0 | throw new RuntimeException(e.getMessage(), e); | 
 
| 84 |  | } | 
 
| 85 |  | }, "html"); | 
 
| 86 |  | } | 
 
| 87 |  |  | 
|  |  | 
            
                |  | 75% | Uncovered Elements: 1 (4) | Complexity: 2 | Complexity Density: 0,5 | 1PASS |  | 
| 88 | 1 |  @Test... | 
 
| 89 |  | public void shouldRenderNestedComponent() { | 
 
| 90 | 1 | verify((htmlSource) -> { | 
 
| 91 | 1 | try { | 
 
| 92 | 1 | return createParser().parse(config, htmlSource).html(); | 
 
| 93 |  | } catch (final IOException e) { | 
 
| 94 | 0 | throw new RuntimeException(e.getMessage(), e); | 
 
| 95 |  | } | 
 
| 96 |  | }, "html"); | 
 
| 97 |  | } | 
 
| 98 |  |  | 
|  |  | 
            
                |  | 100% | Uncovered Elements: 0 (1) | Complexity: 1 | Complexity Density: 1 |  | 
| 99 | 6 |  private SnippetParser createParser() {... | 
 
| 100 | 6 | return new SnippetParser().insertResourcePath(getPackagePath().toString(), 0); | 
 
| 101 |  | } | 
 
| 102 |  | } |