1
|
|
package pro.verron.officestamper.api; |
2
|
|
|
3
|
|
import org.springframework.util.function.ThrowingFunction; |
4
|
|
|
5
|
|
import java.util.function.Function; |
6
|
|
import java.util.function.Supplier; |
7
|
|
|
8
|
|
/** |
9
|
|
* OfficeStamperException is a subclass of RuntimeException that represents an exception that can be thrown during the |
10
|
|
* processing of an Office document using the OfficeStamper library. |
11
|
|
* It provides additional constructors to handle different scenarios. |
12
|
|
*/ |
13
|
|
public class OfficeStamperException |
14
|
|
extends RuntimeException { |
15
|
|
/** |
16
|
|
* OfficeStamperException is a subclass of RuntimeException that represents an exception that can be thrown |
17
|
|
* during the processing of an Office document using the OfficeStamper |
18
|
|
* library. |
19
|
|
* |
20
|
|
* @param message a message describing the error |
21
|
|
*/ |
22
|
|
public OfficeStamperException(String message) { |
23
|
|
super(message); |
24
|
|
} |
25
|
|
|
26
|
|
/** |
27
|
|
* OfficeStamperException is a subclass of RuntimeException that represents an exception that can be thrown |
28
|
|
* during the processing of an Office document using the OfficeStamper |
29
|
|
* library. |
30
|
|
* |
31
|
|
* @param cause the cause of the exception |
32
|
|
*/ |
33
|
|
public OfficeStamperException(Throwable cause) { |
34
|
|
super(cause); |
35
|
|
} |
36
|
|
|
37
|
|
/** |
38
|
|
* OfficeStamperException is a subclass of RuntimeException that represents an exception that can be thrown |
39
|
|
* during the processing of an Office document using the OfficeStamper |
40
|
|
* library. |
41
|
|
* |
42
|
|
* @param message a message describing the error |
43
|
|
* @param cause the cause of the exception |
44
|
|
*/ |
45
|
|
public OfficeStamperException(String message, Throwable cause) { |
46
|
|
super(message, cause); |
47
|
|
} |
48
|
|
|
49
|
|
/** |
50
|
|
* OfficeStamperException is a subclass of RuntimeException |
51
|
|
* that represents an exception |
52
|
|
* that can be thrown during the processing of an Office document using the OfficeStamper |
53
|
|
* library. |
54
|
|
*/ |
55
|
|
public OfficeStamperException() { |
56
|
|
super("Unexpected exception"); |
57
|
|
} |
58
|
|
|
59
|
|
/** |
60
|
|
* Creates a supplier that returns a new instance of {@link OfficeStamperException} with the specified message. |
61
|
|
* |
62
|
|
* @param message the message describing the exception |
63
|
|
* @return a supplier that provides a new {@link OfficeStamperException} instance |
64
|
|
*/ |
65
|
|
public static Supplier<OfficeStamperException> throwing(String message) { |
66
|
2
1. lambda$throwing$0 : replaced return value with null for pro/verron/officestamper/api/OfficeStamperException::lambda$throwing$0 → NO_COVERAGE
2. throwing : replaced return value with null for pro/verron/officestamper/api/OfficeStamperException::throwing → SURVIVED
|
return () -> new OfficeStamperException(message); |
67
|
|
} |
68
|
|
|
69
|
|
/** |
70
|
|
* Wraps a ThrowingFunction into a standard Java Function, converting any checked exceptions |
71
|
|
* thrown by the original function into an OfficeStamperException. |
72
|
|
* |
73
|
|
* @param <T> the type of the input to the function |
74
|
|
* @param <U> the type of the result of the function |
75
|
|
* @param function the throwing function to be wrapped |
76
|
|
* @return a Function that wraps the specified ThrowingFunction and handles exceptions by |
77
|
|
* throwing an OfficeStamperException |
78
|
|
*/ |
79
|
|
public static <T, U> Function<T, U> throwing(ThrowingFunction<T, U> function) { |
80
|
1
1. throwing : replaced return value with null for pro/verron/officestamper/api/OfficeStamperException::throwing → KILLED
|
return ThrowingFunction.of(function, OfficeStamperException::new); |
81
|
|
} |
82
|
|
} |
| | Mutations |
66 |
|
1.1 Location : lambda$throwing$0 Killed by : none replaced return value with null for pro/verron/officestamper/api/OfficeStamperException::lambda$throwing$0 → NO_COVERAGE
2.2 Location : throwing Killed by : none replaced return value with null for pro/verron/officestamper/api/OfficeStamperException::throwing → SURVIVED
Covering tests
Covered by tests:
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfTableRowsTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfTableRowsTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.StampTableTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.StampTableTest]/[test-template:stampTableTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.StampTableTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.StampTableTest]/[test-template:stampTableTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.RepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.RepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatTableRowTest]/[method:shouldAcceptList()]
- pro.verron.officestamper.test.RepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatTableRowTest]/[method:shouldAcceptSet()]
- pro.verron.officestamper.test.RepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#4]
- pro.verron.officestamper.test.RepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatParagraphTest]/[method:shouldAcceptSet()]
- pro.verron.officestamper.test.RepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatParagraphTest]/[method:shouldAcceptQueue()]
- pro.verron.officestamper.test.RepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatTableRowTest]/[method:shouldAcceptQueue()]
- pro.verron.officestamper.test.RepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#5]
- pro.verron.officestamper.test.RepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#3]
- pro.verron.officestamper.test.RepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatParagraphTest]/[method:shouldAcceptList()]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfTableBug32Test(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.RepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfTableTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfTableBug32Test(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.RepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#6]
- pro.verron.officestamper.test.RepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatParagraphTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#6]
- pro.verron.officestamper.test.RepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatParagraphTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#5]
- pro.verron.officestamper.test.RepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatParagraphTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#3]
- pro.verron.officestamper.test.RepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatParagraphTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#4]
- pro.verron.officestamper.test.RepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatParagraphTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#33]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfTableTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.RepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatParagraphTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#15]
- pro.verron.officestamper.test.MultiStampTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.MultiStampTest]/[test-template:repeatDocPart(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.MultiStampTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.MultiStampTest]/[test-template:repeatDocPart(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.CustomFunctionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.CustomFunctionTests]/[test-template:interfaces(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfEndnotes(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.RepeatDocPartTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatDocPartTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#5]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfEndnotes(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.RepeatDocPartTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatDocPartTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#13]
- pro.verron.officestamper.test.CustomFunctionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.CustomFunctionTests]/[test-template:interfaces(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.GoogleDocsSupportTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.GoogleDocsSupportTest]/[method:conditionalRepeatedParagraphs_createdByGoogleDocs()]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfFootnotes(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfHomer(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfHomer(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfFootnotes(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfBart(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfBart(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfAbsentValue(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
- pro.verron.officestamper.test.RepeatDocPartTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatDocPartTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#12]
- pro.verron.officestamper.test.ConditionalDisplayTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ConditionalDisplayTest]/[test-template:conditionalDisplayOfAbsentValue(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
- pro.verron.officestamper.test.RepeatDocPartTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatDocPartTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#4]
|
80 |
|
1.1 Location : throwing Killed by : pro.verron.officestamper.test.SpelInstantiationTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.SpelInstantiationTest]/[test-template:testDateInstantiationAndResolution(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2] replaced return value with null for pro/verron/officestamper/api/OfficeStamperException::throwing → KILLED
|