BuilderUtils.java

1
package fr.sii.ogham.core.util;
2
3
import java.lang.reflect.InvocationTargetException;
4
import java.util.List;
5
import java.util.Properties;
6
import java.util.StringJoiner;
7
8
import fr.sii.ogham.core.builder.Builder;
9
import fr.sii.ogham.core.builder.context.BuildContext;
10
import fr.sii.ogham.core.convert.Converter;
11
import fr.sii.ogham.core.convert.DefaultConverter;
12
import fr.sii.ogham.core.env.PropertyResolver;
13
import fr.sii.ogham.core.exception.builder.BuildException;
14
import fr.sii.ogham.core.fluent.AbstractParent;
15
import fr.sii.ogham.core.fluent.Parent;
16
import fr.sii.ogham.email.builder.EmailBuilder;
17
18
/**
19
 * Helper class for {@link Builder} implementations. It separates the builder
20
 * implementations from the environment.
21
 * 
22
 * @author Aurélien Baudet
23
 * @see Builder
24
 */
25
public final class BuilderUtils {
26
	private static Converter converter;
27
28
	/**
29
	 * Provide the default properties. For now, it provides only
30
	 * {@link System#getProperties()}. But according to the environment or the
31
	 * future of the module, properties may come from other source.
32
	 * 
33
	 * @return the default properties
34
	 */
35
	public static Properties getDefaultProperties() {
36 7 1. getDefaultProperties : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → SURVIVED
2. getDefaultProperties : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → NO_COVERAGE
3. getDefaultProperties : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → KILLED
4. getDefaultProperties : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → KILLED
5. getDefaultProperties : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → KILLED
6. getDefaultProperties : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → KILLED
7. getDefaultProperties : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → KILLED
		return System.getProperties();
37
	}
38
39
	/**
40
	 * If the property value is an expression ({@code "${property.key}"}), then
41
	 * it is evaluated to get the value of "property.key". If the value is not
42
	 * an expression, the value is returned and converted to the result class.
43
	 * 
44
	 * @param <T>
45
	 *            the type of the resulting property
46
	 * @param property
47
	 *            the property that may be an expression
48
	 * @param propertyResolver
49
	 *            the property resolver used to find property value (if it is an
50
	 *            expression)
51
	 * @param resultClass
52
	 *            the result class
53
	 * @return the resulting value of the expression, the value or null
54
	 */
55
	public static <T> T evaluate(String property, PropertyResolver propertyResolver, Class<T> resultClass) {
56 8 1. evaluate : negated conditional → NO_COVERAGE
2. evaluate : negated conditional → TIMED_OUT
3. evaluate : negated conditional → KILLED
4. evaluate : negated conditional → KILLED
5. evaluate : negated conditional → KILLED
6. evaluate : negated conditional → KILLED
7. evaluate : negated conditional → KILLED
8. evaluate : negated conditional → KILLED
		if (isExpression(property)) {
57 8 1. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → NO_COVERAGE
2. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
3. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
4. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
5. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
6. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
7. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
8. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
			return propertyResolver.getProperty(getPropertyKey(property), resultClass);
58
		}
59 1 1. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → NO_COVERAGE
		return getConverter().convert(property, resultClass);
60
	}
61
62
	/**
63
	 * Evaluate a list of properties that may contain expressions. It internally
64
	 * calls {@link #evaluate(String, PropertyResolver, Class)}. It tries on
65
	 * first property in the list. If {@code null} value is returned then the
66
	 * next property is tried and so on until one property returns a non-null
67
	 * value.
68
	 * 
69
	 * <p>
70
	 * If all properties return null, it returns null.
71
	 * 
72
	 * @param <T>
73
	 *            the type of resulting value
74
	 * @param properties
75
	 *            the list of properties to try in sequence
76
	 * @param propertyResolver
77
	 *            the property resolver used to find property value (if it is an
78
	 *            expression)
79
	 * @param resultClass
80
	 *            the result class
81
	 * @return the resulting value or null
82
	 */
83
	public static <T> T evaluate(List<String> properties, PropertyResolver propertyResolver, Class<T> resultClass) {
84 9 1. evaluate : negated conditional → SURVIVED
2. evaluate : negated conditional → TIMED_OUT
3. evaluate : negated conditional → KILLED
4. evaluate : negated conditional → KILLED
5. evaluate : negated conditional → KILLED
6. evaluate : negated conditional → KILLED
7. evaluate : negated conditional → KILLED
8. evaluate : negated conditional → KILLED
9. evaluate : negated conditional → KILLED
		if (properties == null) {
85
			return null;
86
		}
87
		for (String prop : properties) {
88
			T value = evaluate(prop, propertyResolver, resultClass);
89 8 1. evaluate : negated conditional → NO_COVERAGE
2. evaluate : negated conditional → KILLED
3. evaluate : negated conditional → KILLED
4. evaluate : negated conditional → KILLED
5. evaluate : negated conditional → KILLED
6. evaluate : negated conditional → KILLED
7. evaluate : negated conditional → KILLED
8. evaluate : negated conditional → KILLED
			if (value != null) {
90 8 1. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → NO_COVERAGE
2. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
3. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
4. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
5. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
6. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
7. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
8. evaluate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED
				return value;
91
			}
92
		}
93
		return null;
94
	}
95
96
	/**
97
	 * Get the property of inside the expression
98
	 * 
99
	 * @param expression
100
	 *            the property expression
101
	 * @return the property key
102
	 */
103
	public static String getPropertyKey(String expression) {
104 15 1. getPropertyKey : replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → NO_COVERAGE
2. getPropertyKey : Replaced integer subtraction with addition → NO_COVERAGE
3. getPropertyKey : replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → TIMED_OUT
4. getPropertyKey : Replaced integer subtraction with addition → TIMED_OUT
5. getPropertyKey : replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → KILLED
6. getPropertyKey : replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → KILLED
7. getPropertyKey : replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → KILLED
8. getPropertyKey : replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → KILLED
9. getPropertyKey : replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → KILLED
10. getPropertyKey : Replaced integer subtraction with addition → KILLED
11. getPropertyKey : Replaced integer subtraction with addition → KILLED
12. getPropertyKey : Replaced integer subtraction with addition → KILLED
13. getPropertyKey : Replaced integer subtraction with addition → KILLED
14. getPropertyKey : Replaced integer subtraction with addition → KILLED
15. getPropertyKey : Replaced integer subtraction with addition → KILLED
		return expression.substring(2, expression.length() - 1);
105
	}
106
107
	/**
108
	 * Indicates if the property is the form of an expression
109
	 * ("${property.key}") or not.
110
	 * 
111
	 * @param property
112
	 *            the property that may be an expression
113
	 * @return true if it is an expression, false otherwise
114
	 */
115
	public static boolean isExpression(String property) {
116 26 1. isExpression : replaced boolean return with true for fr/sii/ogham/core/util/BuilderUtils::isExpression → NO_COVERAGE
2. isExpression : replaced boolean return with true for fr/sii/ogham/core/util/BuilderUtils::isExpression → SURVIVED
3. isExpression : negated conditional → NO_COVERAGE
4. isExpression : negated conditional → NO_COVERAGE
5. isExpression : negated conditional → NO_COVERAGE
6. isExpression : negated conditional → KILLED
7. isExpression : negated conditional → KILLED
8. isExpression : negated conditional → KILLED
9. isExpression : negated conditional → KILLED
10. isExpression : negated conditional → KILLED
11. isExpression : negated conditional → KILLED
12. isExpression : negated conditional → KILLED
13. isExpression : negated conditional → KILLED
14. isExpression : negated conditional → KILLED
15. isExpression : negated conditional → KILLED
16. isExpression : negated conditional → KILLED
17. isExpression : negated conditional → KILLED
18. isExpression : negated conditional → KILLED
19. isExpression : negated conditional → KILLED
20. isExpression : negated conditional → KILLED
21. isExpression : negated conditional → KILLED
22. isExpression : negated conditional → KILLED
23. isExpression : negated conditional → KILLED
24. isExpression : negated conditional → KILLED
25. isExpression : negated conditional → KILLED
26. isExpression : negated conditional → KILLED
		return property != null && property.startsWith("${") && property.endsWith("}");
117
	}
118
119
	/**
120
	 * Change the converter used by ByulderUtils
121
	 * 
122
	 * @param converter
123
	 *            the new converter
124
	 */
125
	public static void setConverter(Converter converter) {
126
		BuilderUtils.converter = converter;
127
	}
128
129
	// @formatter:off
130
	/**
131
	 * Utility method used to dynamically instantiate a builder instance.
132
	 * 
133
	 * <p>
134
	 * If you want fluent chaining, your builder class <strong>MUST</strong>
135
	 * declare parent of type {@code P} as first parameter. The builder can
136
	 * implement {@link Parent} or even extend {@link AbstractParent}. For
137
	 * example, if builder is a child of {@link EmailBuilder}:
138
	 * 
139
	 * <pre>
140
	 * {@code
141
	 * class MyBuilder extends AbstractParent<EmailBuilder> implements Builder<Foo> {
142
	 *   public MyBuilder(EmailBuilder parent) {
143
	 *     super(parent);
144
	 *   }
145
	 * }
146
	 * }</pre>
147
	 * 
148
	 * 
149
	 * <p>
150
	 * You may need {@link BuildContext} in order to be able to evaluate
151
	 * properties in your {@link Builder#build()} method. Just declare a
152
	 * parameter of type {@link BuildContext} either as first parameter if
153
	 * you don't want fluent chaining:
154
	 * 
155
	 * <pre>
156
	 * {@code
157
	 * class MyBuilder implements Builder<Foo> {
158
	 *   public MyBuilder(BuildContext buildContext) {
159
	 *     this.buildContext = buildContext;
160
	 *   }
161
	 * }
162
	 * }</pre>
163
	 * 
164
	 * or as second parameter if you want fluent chaining:
165
	 * 
166
	 * <pre>
167
	 * {@code
168
	 * class MyBuilder extends AbstractParent<EmailBuilder> implements Builder<Foo> {
169
	 *   public MyBuilder(EmailBuilder parent, BuildContext buildContext) {
170
	 *     super(parent);
171
	 *     this.buildContext = buildContext;
172
	 *   }
173
	 * }
174
	 * }</pre>
175
	 * 
176
	 * 
177
	 * <p>
178
	 * If you need none of these features, you still have to provide a public
179
	 * default constructor.
180
	 * 
181
	 * <p>
182
	 * If several constructors exist, the following order is used (first
183
	 * matching constructor is used):
184
	 * <ul>
185
	 * <li>{@code contructor(P parent, BuildContext buildContext)}</li>
186
	 * <li>{@code contructor(P parent}</li>
187
	 * <li>{@code contructor(BuildContext buildContext)}</li>
188
	 * <li>{@code contructor(}</li>
189
	 * </ul>
190
	 * 
191
	 * @param <T>
192
	 *            The type of the built object
193
	 * @param <B>
194
	 *            The type of the builder that builds T
195
	 * @param <P>
196
	 *            The type of the parent builder (used for fluent chaining)
197
	 * @param builderClass
198
	 *            The builder class to instantiate
199
	 * @param parent
200
	 *            The parent builder for fluent chaining
201
	 * @param buildContext
202
	 *            The current build context
203
	 * @return the builder instance
204
	 * @throws BuildException
205
	 *             when builder can't be instantiated
206
	 */
207
	// @formatter:on
208
	@SuppressWarnings("squid:RedundantThrowsDeclarationCheck")
209
	public static <T, B extends Builder<? extends T>, P> B instantiateBuilder(Class<B> builderClass, P parent, BuildContext buildContext) throws BuildException {
210
		try {
211 8 1. instantiateBuilder : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → NO_COVERAGE
2. instantiateBuilder : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED
3. instantiateBuilder : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED
4. instantiateBuilder : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED
5. instantiateBuilder : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED
6. instantiateBuilder : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED
7. instantiateBuilder : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED
8. instantiateBuilder : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED
			return instantiate(builderClass, parent, buildContext);
212
		} catch (InstantiationException | IllegalAccessException | InvocationTargetException | SecurityException | IllegalArgumentException e) {
213
			throw new BuildException("Can't instantiate builder from class " + builderClass.getSimpleName(), e);
214
		}
215
	}
216
217
	/**
218
	 * Build the instance using the provided builder.
219
	 * 
220
	 * <p>
221
	 * If builder is {@code null}, it returns {@code null}.
222
	 * 
223
	 * <p>
224
	 * If builder is not {@code null}, the value of {@link Builder#build()} is
225
	 * used. The returned value may be {@code null}.
226
	 * 
227
	 * @param <T>
228
	 *            the type of the built instance
229
	 * @param builder
230
	 *            the builder
231
	 * @return the built instance or null if builder is null or if it returns
232
	 *         null
233
	 */
234
	public static <T> T build(Builder<T> builder) {
235 6 1. build : negated conditional → SURVIVED
2. build : negated conditional → NO_COVERAGE
3. build : negated conditional → KILLED
4. build : negated conditional → KILLED
5. build : negated conditional → KILLED
6. build : negated conditional → KILLED
		if (builder == null) {
236
			return null;
237
		}
238 6 1. build : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::build → NO_COVERAGE
2. build : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::build → SURVIVED
3. build : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::build → TIMED_OUT
4. build : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::build → KILLED
5. build : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::build → KILLED
6. build : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::build → KILLED
		return builder.build();
239
	}
240
241
	private static <T, B extends Builder<? extends T>, P> B instantiate(Class<B> builderClass, P parent, BuildContext buildContext)
242
			throws InstantiationException, IllegalAccessException, InvocationTargetException {
243
		try {
244 8 1. instantiate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → NO_COVERAGE
2. instantiate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED
3. instantiate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED
4. instantiate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED
5. instantiate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED
6. instantiate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED
7. instantiate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED
8. instantiate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED
			return builderClass.getConstructor(parent.getClass(), BuildContext.class).newInstance(parent, buildContext);
245
		} catch (NoSuchMethodException e) {
246
			// skip
247
		}
248
		try {
249 1 1. instantiate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → NO_COVERAGE
			return builderClass.getConstructor(parent.getClass()).newInstance(parent);
250
		} catch (NoSuchMethodException e) {
251
			// skip
252
		}
253
		try {
254 1 1. instantiate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → NO_COVERAGE
			return builderClass.getConstructor(BuildContext.class).newInstance(buildContext);
255
		} catch (NoSuchMethodException e) {
256
			// skip
257
		}
258
		try {
259 2 1. instantiate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → NO_COVERAGE
2. instantiate : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED
			return builderClass.getConstructor().newInstance();
260
		} catch (NoSuchMethodException e) {
261
			// skip
262
		}
263
		StringJoiner joiner = new StringJoiner("\n- ", "\n- ", "\n");
264
		joiner.add("constructor(" + parent.getClass().getName() + ", " + BuildContext.class.getName() + ")\n   if you want fluent chaining and inherit current build context");
265
		joiner.add("constructor(" + parent.getClass().getName() + ")\n   if you want fluent chaining");
266
		joiner.add("constructor(" + BuildContext.class.getName() + ")\n   if you don't want fluent chaining but inherit current build context");
267
		joiner.add("constructor()\n   if you don't want fluent chaining and inherit current build context");
268
		throw new BuildException("No matching constructor found. The builder implementation must provide one of following constructors:" + joiner.toString());
269
	}
270
271
	private static Converter getConverter() {
272 1 1. getConverter : negated conditional → NO_COVERAGE
		if (converter == null) {
273
			converter = new DefaultConverter();
274
		}
275 1 1. getConverter : replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getConverter → NO_COVERAGE
		return converter;
276
	}
277
278
	private BuilderUtils() {
279
		super();
280
	}
281
282
}

Mutations

36

1.1
Location : getDefaultProperties
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → KILLED

2.2
Location : getDefaultProperties
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → SURVIVED

3.3
Location : getDefaultProperties
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → NO_COVERAGE

4.4
Location : getDefaultProperties
Killed by : oghamjavamail.it.UnreadableAttachmentTest.attachmentUnreadable(oghamjavamail.it.UnreadableAttachmentTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → KILLED

5.5
Location : getDefaultProperties
Killed by : oghamall.it.html.translator.JsoupInlineCssTranslatorTest.notHtml(oghamall.it.html.translator.JsoupInlineCssTranslatorTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → KILLED

6.6
Location : getDefaultProperties
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → KILLED

7.7
Location : getDefaultProperties
Killed by : oghamcore.it.core.configuration.ConfigurationLifecycleSpec
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getDefaultProperties → KILLED

56

1.1
Location : evaluate
Killed by : none
negated conditional → TIMED_OUT

2.2
Location : evaluate
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
negated conditional → KILLED

3.3
Location : evaluate
Killed by : oghamall.it.configuration.EmptyBuilderTest.emailSenderManuallyRegisteredButUnconfiguredTemplateParsersCantHandleMultiTemplateContent(oghamall.it.configuration.EmptyBuilderTest)
negated conditional → KILLED

4.4
Location : evaluate
Killed by : oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest.smsUsingThymeleafTemplateShouldResolveBeansAndUrls(oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest)
negated conditional → KILLED

5.5
Location : evaluate
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location : evaluate
Killed by : oghamjavamail.it.builder.OverridePropertiesTest.overridePropertiesWithEmptyProps(oghamjavamail.it.builder.OverridePropertiesTest)
negated conditional → KILLED

7.7
Location : evaluate
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
negated conditional → KILLED

8.8
Location : evaluate
Killed by : oghamcore.it.core.configuration.ConfigurationLifecycleSpec
negated conditional → KILLED

57

1.1
Location : evaluate
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

2.2
Location : evaluate
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

3.3
Location : evaluate
Killed by : oghamspringbootv2autoconfigure.it.StaticMethodAccessTest.emailUsingFreemarkerTemplateAndStaticMethodAccessDisabledShouldFail(oghamspringbootv2autoconfigure.it.StaticMethodAccessTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

4.4
Location : evaluate
Killed by : oghamcore.it.core.configuration.ConfigurationLifecycleSpec
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

5.5
Location : evaluate
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → NO_COVERAGE

6.6
Location : evaluate
Killed by : oghamall.it.configuration.SendGridConfigurationTest.asDeveloperIDefineApiKeyUsingProperties(oghamall.it.configuration.SendGridConfigurationTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

7.7
Location : evaluate
Killed by : oghamspringbootv1autoconfigure.it.StaticMethodsAccessTest.emailUsingFreemarkerTemplateShouldBeAbleToCallStaticMethods(oghamspringbootv1autoconfigure.it.StaticMethodsAccessTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

8.8
Location : evaluate
Killed by : oghamjavamail.it.builder.OverridePropertiesTest.overrideProperties(oghamjavamail.it.builder.OverridePropertiesTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

59

1.1
Location : evaluate
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → NO_COVERAGE

84

1.1
Location : evaluate
Killed by : oghamspringbootv2autoconfigure.it.StaticMethodAccessTest.emailUsingFreemarkerTemplateAndStaticMethodAccessDisabledShouldFail(oghamspringbootv2autoconfigure.it.StaticMethodAccessTest)
negated conditional → KILLED

2.2
Location : evaluate
Killed by : none
negated conditional → TIMED_OUT

3.3
Location : evaluate
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
negated conditional → KILLED

4.4
Location : evaluate
Killed by : oghamall.it.configuration.SendGridConfigurationTest.asDeveloperIDefineApiKeyUsingProperties(oghamall.it.configuration.SendGridConfigurationTest)
negated conditional → KILLED

5.5
Location : evaluate
Killed by : oghamcore.it.core.configuration.ConfigurationLifecycleSpec
negated conditional → KILLED

6.6
Location : evaluate
Killed by : none
negated conditional → SURVIVED

7.7
Location : evaluate
Killed by : oghamspringbootv1autoconfigure.it.StaticMethodsAccessTest.emailUsingFreemarkerTemplateShouldBeAbleToCallStaticMethods(oghamspringbootv1autoconfigure.it.StaticMethodsAccessTest)
negated conditional → KILLED

8.8
Location : evaluate
Killed by : oghamjavamail.it.builder.OverridePropertiesTest.overrideProperties(oghamjavamail.it.builder.OverridePropertiesTest)
negated conditional → KILLED

9.9
Location : evaluate
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
negated conditional → KILLED

89

1.1
Location : evaluate
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
negated conditional → KILLED

2.2
Location : evaluate
Killed by : oghamspringbootv1autoconfigure.it.StaticMethodsAccessTest.emailUsingFreemarkerTemplateShouldBeAbleToCallStaticMethods(oghamspringbootv1autoconfigure.it.StaticMethodsAccessTest)
negated conditional → KILLED

3.3
Location : evaluate
Killed by : oghamjavamail.it.builder.OverridePropertiesTest.overrideProperties(oghamjavamail.it.builder.OverridePropertiesTest)
negated conditional → KILLED

4.4
Location : evaluate
Killed by : oghamall.it.configuration.SendGridConfigurationTest.asDeveloperIDefineApiKeyUsingProperties(oghamall.it.configuration.SendGridConfigurationTest)
negated conditional → KILLED

5.5
Location : evaluate
Killed by : oghamcore.it.core.configuration.ConfigurationLifecycleSpec
negated conditional → KILLED

6.6
Location : evaluate
Killed by : none
negated conditional → NO_COVERAGE

7.7
Location : evaluate
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
negated conditional → KILLED

8.8
Location : evaluate
Killed by : oghamspringbootv2autoconfigure.it.StaticMethodAccessTest.emailUsingFreemarkerTemplateAndStaticMethodAccessDisabledShouldFail(oghamspringbootv2autoconfigure.it.StaticMethodAccessTest)
negated conditional → KILLED

90

1.1
Location : evaluate
Killed by : oghamcore.it.core.configuration.ConfigurationLifecycleSpec
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

2.2
Location : evaluate
Killed by : oghamall.it.configuration.SendGridConfigurationTest.asDeveloperIDefineApiKeyUsingProperties(oghamall.it.configuration.SendGridConfigurationTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

3.3
Location : evaluate
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

4.4
Location : evaluate
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → NO_COVERAGE

5.5
Location : evaluate
Killed by : oghamjavamail.it.builder.OverridePropertiesTest.overrideProperties(oghamjavamail.it.builder.OverridePropertiesTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

6.6
Location : evaluate
Killed by : oghamspringbootv2autoconfigure.it.StaticMethodAccessTest.emailUsingFreemarkerTemplateAndStaticMethodAccessDisabledShouldFail(oghamspringbootv2autoconfigure.it.StaticMethodAccessTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

7.7
Location : evaluate
Killed by : oghamspringbootv1autoconfigure.it.StaticMethodsAccessTest.emailUsingFreemarkerTemplateShouldBeAbleToCallStaticMethods(oghamspringbootv1autoconfigure.it.StaticMethodsAccessTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

8.8
Location : evaluate
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::evaluate → KILLED

104

1.1
Location : getPropertyKey
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → KILLED

2.2
Location : getPropertyKey
Killed by : oghamcore.it.core.configuration.ConfigurationLifecycleSpec
replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → KILLED

3.3
Location : getPropertyKey
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → KILLED

4.4
Location : getPropertyKey
Killed by : none
replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → NO_COVERAGE

5.5
Location : getPropertyKey
Killed by : oghamjavamail.it.builder.OverridePropertiesTest.overrideProperties(oghamjavamail.it.builder.OverridePropertiesTest)
replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → KILLED

6.6
Location : getPropertyKey
Killed by : oghamall.it.configuration.SendGridConfigurationTest.asDeveloperIDefineApiKeyUsingProperties(oghamall.it.configuration.SendGridConfigurationTest)
replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → KILLED

7.7
Location : getPropertyKey
Killed by : none
replaced return value with "" for fr/sii/ogham/core/util/BuilderUtils::getPropertyKey → TIMED_OUT

8.8
Location : getPropertyKey
Killed by : oghamcore.it.core.configuration.ConfigurationLifecycleSpec
Replaced integer subtraction with addition → KILLED

9.9
Location : getPropertyKey
Killed by : oghamjavamail.it.builder.OverridePropertiesTest.overridePropertiesWithEmptyProps(oghamjavamail.it.builder.OverridePropertiesTest)
Replaced integer subtraction with addition → KILLED

10.10
Location : getPropertyKey
Killed by : oghamall.it.configuration.EmptyBuilderTest.emailSenderManuallyRegisteredButUnconfiguredTemplateParsersCantHandleMultiTemplateContent(oghamall.it.configuration.EmptyBuilderTest)
Replaced integer subtraction with addition → KILLED

11.11
Location : getPropertyKey
Killed by : none
Replaced integer subtraction with addition → TIMED_OUT

12.12
Location : getPropertyKey
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
Replaced integer subtraction with addition → KILLED

13.13
Location : getPropertyKey
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
Replaced integer subtraction with addition → KILLED

14.14
Location : getPropertyKey
Killed by : none
Replaced integer subtraction with addition → NO_COVERAGE

15.15
Location : getPropertyKey
Killed by : oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest.smsUsingThymeleafTemplateShouldResolveBeansAndUrls(oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest)
Replaced integer subtraction with addition → KILLED

116

1.1
Location : isExpression
Killed by : none
replaced boolean return with true for fr/sii/ogham/core/util/BuilderUtils::isExpression → NO_COVERAGE

2.2
Location : isExpression
Killed by : none
replaced boolean return with true for fr/sii/ogham/core/util/BuilderUtils::isExpression → SURVIVED

3.3
Location : isExpression
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
negated conditional → KILLED

4.4
Location : isExpression
Killed by : oghamspringbootv2autoconfigure.it.SpringWebBeanResolutionTest.smsUsingThymeleafTemplateShouldResolveBeansAndUrls(oghamspringbootv2autoconfigure.it.SpringWebBeanResolutionTest)
negated conditional → KILLED

5.5
Location : isExpression
Killed by : oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest.smsUsingThymeleafTemplateShouldResolveBeansAndUrls(oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest)
negated conditional → KILLED

6.6
Location : isExpression
Killed by : none
negated conditional → NO_COVERAGE

7.7
Location : isExpression
Killed by : oghamjavamail.it.builder.OverridePropertiesTest.overridePropertiesWithEmptyProps(oghamjavamail.it.builder.OverridePropertiesTest)
negated conditional → KILLED

8.8
Location : isExpression
Killed by : oghamall.it.configuration.EmptyBuilderTest.emailSenderManuallyRegisteredButUnconfiguredTemplateParsersCantHandleMultiTemplateContent(oghamall.it.configuration.EmptyBuilderTest)
negated conditional → KILLED

9.9
Location : isExpression
Killed by : oghamcore.it.core.configuration.ConfigurationLifecycleSpec
negated conditional → KILLED

10.10
Location : isExpression
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
negated conditional → KILLED

11.11
Location : isExpression
Killed by : oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest.smsUsingThymeleafTemplateShouldResolveBeansAndUrls(oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest)
negated conditional → KILLED

12.12
Location : isExpression
Killed by : none
negated conditional → NO_COVERAGE

13.13
Location : isExpression
Killed by : oghamcore.it.core.configuration.ConfigurationLifecycleSpec
negated conditional → KILLED

14.14
Location : isExpression
Killed by : oghamall.it.configuration.EmptyBuilderTest.emailSenderManuallyRegisteredButUnconfiguredTemplateParsersCantHandleMultiTemplateContent(oghamall.it.configuration.EmptyBuilderTest)
negated conditional → KILLED

15.15
Location : isExpression
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
negated conditional → KILLED

16.16
Location : isExpression
Killed by : oghamjavamail.it.builder.OverridePropertiesTest.overridePropertiesWithEmptyProps(oghamjavamail.it.builder.OverridePropertiesTest)
negated conditional → KILLED

17.17
Location : isExpression
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
negated conditional → KILLED

18.18
Location : isExpression
Killed by : oghamspringbootv2autoconfigure.it.SpringWebBeanResolutionTest.smsUsingThymeleafTemplateShouldResolveBeansAndUrls(oghamspringbootv2autoconfigure.it.SpringWebBeanResolutionTest)
negated conditional → KILLED

19.19
Location : isExpression
Killed by : oghamall.it.configuration.EmptyBuilderTest.emailSenderManuallyRegisteredButUnconfiguredTemplateParsersCantHandleMultiTemplateContent(oghamall.it.configuration.EmptyBuilderTest)
negated conditional → KILLED

20.20
Location : isExpression
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
negated conditional → KILLED

21.21
Location : isExpression
Killed by : oghamcore.it.core.configuration.ConfigurationLifecycleSpec
negated conditional → KILLED

22.22
Location : isExpression
Killed by : oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest.smsUsingThymeleafTemplateShouldResolveBeansAndUrls(oghamspringbootv1autoconfigure.it.SpringWebBeanResolutionTest)
negated conditional → KILLED

23.23
Location : isExpression
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
negated conditional → KILLED

24.24
Location : isExpression
Killed by : oghamjavamail.it.builder.OverridePropertiesTest.overridePropertiesWithEmptyProps(oghamjavamail.it.builder.OverridePropertiesTest)
negated conditional → KILLED

25.25
Location : isExpression
Killed by : oghamspringbootv2autoconfigure.it.SpringWebBeanResolutionTest.smsUsingThymeleafTemplateShouldResolveBeansAndUrls(oghamspringbootv2autoconfigure.it.SpringWebBeanResolutionTest)
negated conditional → KILLED

26.26
Location : isExpression
Killed by : none
negated conditional → NO_COVERAGE

211

1.1
Location : instantiateBuilder
Killed by : oghamjavamail.it.builder.JavaMailCustomConfigurationTest.noHostDefinedShouldFail(oghamjavamail.it.builder.JavaMailCustomConfigurationTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED

2.2
Location : instantiateBuilder
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED

3.3
Location : instantiateBuilder
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → NO_COVERAGE

4.4
Location : instantiateBuilder
Killed by : oghamcore.it.core.builder.CustomSenderBuilderTest.asDeveloperIRegisterACustomBuilderWithoutFluentChaining(oghamcore.it.core.builder.CustomSenderBuilderTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED

5.5
Location : instantiateBuilder
Killed by : oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests.oghamPropertiesWithSpringPropsShouldUseOghamPropertiesPrecedence(oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED

6.6
Location : instantiateBuilder
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED

7.7
Location : instantiateBuilder
Killed by : oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests.oghamAloneShouldUseOghamProperties(oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED

8.8
Location : instantiateBuilder
Killed by : oghamall.it.configuration.EmptyBuilderTest.noMimetypeConfigurationCantSendEmail(oghamall.it.configuration.EmptyBuilderTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiateBuilder → KILLED

235

1.1
Location : build
Killed by : oghamall.it.configuration.EmptyBuilderTest.emailSenderManuallyRegisteredButUnconfiguredTemplateParsersCantHandleMultiTemplateContent(oghamall.it.configuration.EmptyBuilderTest)
negated conditional → KILLED

2.2
Location : build
Killed by : oghamjavamail.it.builder.JavaMailCustomConfigurationTest.noHostDefinedShouldFail(oghamjavamail.it.builder.JavaMailCustomConfigurationTest)
negated conditional → KILLED

3.3
Location : build
Killed by : none
negated conditional → SURVIVED

4.4
Location : build
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
negated conditional → KILLED

5.5
Location : build
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location : build
Killed by : oghamcore.it.core.sender.AutoRetryTest.smsNotRetriedOnFirstExecutionDueToParsingError(oghamcore.it.core.sender.AutoRetryTest)
negated conditional → KILLED

238

1.1
Location : build
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::build → NO_COVERAGE

2.2
Location : build
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::build → SURVIVED

3.3
Location : build
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::build → KILLED

4.4
Location : build
Killed by : oghamcore.it.core.sender.AutoRetryTest.smsNotRetriedOnFirstExecutionDueToParsingError(oghamcore.it.core.sender.AutoRetryTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::build → KILLED

5.5
Location : build
Killed by : oghamall.it.retry.AutoRetryTest.doNotResendEmailIfTemplateNotFound(oghamall.it.retry.AutoRetryTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::build → KILLED

6.6
Location : build
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::build → TIMED_OUT

244

1.1
Location : instantiate
Killed by : oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests.oghamAloneShouldUseOghamProperties(oghamspringbootv1autoconfigure.it.OghamSpringBoot1JavaMailAutoConfigurationTests)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED

2.2
Location : instantiate
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED

3.3
Location : instantiate
Killed by : oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests.oghamPropertiesWithSpringPropsShouldUseOghamPropertiesPrecedence(oghamspringbootv2autoconfigure.it.OghamSpringBoot2JavaMailAutoConfigurationTests)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED

4.4
Location : instantiate
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → NO_COVERAGE

5.5
Location : instantiate
Killed by : oghamcore.it.core.builder.CustomTemplateBuilderTest.asDeveloperIRegisterACustomBuilderWithFluentChaining(oghamcore.it.core.builder.CustomTemplateBuilderTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED

6.6
Location : instantiate
Killed by : oghamjavamail.it.builder.JavaMailCustomConfigurationTest.noHostDefinedShouldFail(oghamjavamail.it.builder.JavaMailCustomConfigurationTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED

7.7
Location : instantiate
Killed by : oghamall.it.configuration.EmptyBuilderTest.noMimetypeConfigurationCantSendEmail(oghamall.it.configuration.EmptyBuilderTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED

8.8
Location : instantiate
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED

249

1.1
Location : instantiate
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → NO_COVERAGE

254

1.1
Location : instantiate
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → NO_COVERAGE

259

1.1
Location : instantiate
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → NO_COVERAGE

2.2
Location : instantiate
Killed by : oghamcore.it.core.builder.CustomSenderBuilderTest.asDeveloperIRegisterACustomBuilderWithoutFluentChaining(oghamcore.it.core.builder.CustomSenderBuilderTest)
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::instantiate → KILLED

272

1.1
Location : getConverter
Killed by : none
negated conditional → NO_COVERAGE

275

1.1
Location : getConverter
Killed by : none
replaced return value with null for fr/sii/ogham/core/util/BuilderUtils::getConverter → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT OGHAM