1. Project Clover database mar. janv. 20 2026 12:32:22 CET
  2. Package org.devacfr.maven.skins.reflow.snippet

File SnippetBreadcrumbTest.java

 

Code metrics

0
30
6
1
96
72
12
0,4
5
6
2

Classes

Class Line # Actions
SnippetBreadcrumbTest 22 30 0% 12 6
0.833333383,3%
 

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.snippet;
17   
18    import java.io.IOException;
19    import org.devacfr.maven.skins.reflow.context.PositionType;
20    import org.junit.jupiter.api.Test;
21   
 
22    public class SnippetBreadcrumbTest extends BaseSnippetTest {
23   
 
24  1 toggle @Test
25    public void shouldDisplayDatePositionToLeft() throws Exception {
26  1 when(config.getDatePosition()).thenReturn(PositionType.left.toString());
27  1 verify((htmlSource) -> {
28  1 try {
29  1 return createParser().parse(config, htmlSource).html();
30    } catch (final IOException e) {
31  0 throw new RuntimeException(e.getMessage(), e);
32    }
33    }, "html");
34    }
35   
 
36  1 toggle @Test
37    public void shouldDisplayDatePositionToRight() throws Exception {
38  1 when(config.getDatePosition()).thenReturn(PositionType.right.toString());
39  1 verify((htmlSource) -> {
40  1 try {
41  1 return createParser().parse(config, htmlSource).html();
42    } catch (final IOException e) {
43  0 throw new RuntimeException(e.getMessage(), e);
44    }
45    }, "html");
46    }
47   
 
48  1 toggle @Test
49    public void shouldDisplayVersionPositionToLeft() throws Exception {
50  1 when(config.getVersionPosition()).thenReturn(PositionType.left.toString());
51  1 verify((htmlSource) -> {
52  1 try {
53  1 return createParser().parse(config, htmlSource).html();
54    } catch (final IOException e) {
55  0 throw new RuntimeException(e.getMessage(), e);
56    }
57    }, "html");
58    }
59   
 
60  1 toggle @Test
61    public void shouldDisplayVersionPositionToRight() throws Exception {
62  1 when(config.getVersionPosition()).thenReturn(PositionType.right.toString());
63  1 verify((htmlSource) -> {
64  1 try {
65  1 return createParser().parse(config, htmlSource).html();
66    } catch (final IOException e) {
67  0 throw new RuntimeException(e.getMessage(), e);
68    }
69    }, "html");
70    }
71   
 
72  1 toggle @Test
73    public void shouldNotDisplayDate() throws Exception {
74  1 when(config.getDatePosition()).thenReturn(PositionType.none.toString());
75  1 verify((htmlSource) -> {
76  1 try {
77  1 return createParser().parse(config, htmlSource).html();
78    } catch (final IOException e) {
79  0 throw new RuntimeException(e.getMessage(), e);
80    }
81    }, "html");
82    }
83   
 
84  1 toggle @Test
85    public void shouldNotDisplayDateForUnrecognizedPosition() throws Exception {
86  1 when(config.getDatePosition()).thenReturn(PositionType.bottom.toString());
87  1 verify((htmlSource) -> {
88  1 try {
89  1 return createParser().parse(config, htmlSource).html();
90    } catch (final IOException e) {
91  0 throw new RuntimeException(e.getMessage(), e);
92    }
93    }, "html");
94    }
95   
96    }