DefaultBuildContext.java

1
package fr.sii.ogham.core.builder.context;
2
3
import java.util.List;
4
import java.util.Properties;
5
import java.util.function.Function;
6
7
import fr.sii.ogham.core.builder.configuration.ConfigurationValueBuilder;
8
import fr.sii.ogham.core.builder.configuration.ConfigurationValueBuilderHelper;
9
import fr.sii.ogham.core.convert.Converter;
10
import fr.sii.ogham.core.convert.DefaultConverter;
11
import fr.sii.ogham.core.env.JavaPropertiesResolver;
12
import fr.sii.ogham.core.env.PropertyResolver;
13
import fr.sii.ogham.core.util.BuilderUtils;
14
15
/**
16
 * Simple build context that uses a default {@link PropertyResolver} and a
17
 * default {@link Converter}.
18
 * 
19
 * <p>
20
 * <strong>WARNING: don't use it, this is for for advanced usage only
21
 * !!!</strong>
22
 * 
23
 * 
24
 * @author Aurélien Baudet
25
 *
26
 */
27
public class DefaultBuildContext implements BuildContext {
28
	private final PropertyResolver propertyResolver;
29
	private final Converter converter;
30
31
	public DefaultBuildContext() {
32
		this(new Properties());
33
	}
34
35
	public DefaultBuildContext(Properties props) {
36
		super();
37
		this.converter = new DefaultConverter();
38
		this.propertyResolver = new JavaPropertiesResolver(props, converter);
39
	}
40
41
	@Override
42
	public <T> T register(T instance) {
43 9 1. register : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → NO_COVERAGE
2. register : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED
3. register : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED
4. register : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED
5. register : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED
6. register : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED
7. register : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED
8. register : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED
9. register : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED
		return instance;
44
	}
45
46
	@Override
47
	public <T> T evaluate(List<String> properties, Class<T> resultClass) {
48 3 1. evaluate : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::evaluate → NO_COVERAGE
2. evaluate : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::evaluate → SURVIVED
3. evaluate : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::evaluate → TIMED_OUT
		return BuilderUtils.evaluate(properties, getPropertyResolver(), resultClass);
49
	}
50
51
	@Override
52
	public PropertyResolver getPropertyResolver() {
53 4 1. getPropertyResolver : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::getPropertyResolver → SURVIVED
2. getPropertyResolver : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::getPropertyResolver → NO_COVERAGE
3. getPropertyResolver : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::getPropertyResolver → TIMED_OUT
4. getPropertyResolver : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::getPropertyResolver → KILLED
		return propertyResolver;
54
	}
55
56
	@Override
57
	public Converter getConverter() {
58 2 1. getConverter : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::getConverter → NO_COVERAGE
2. getConverter : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::getConverter → KILLED
		return converter;
59
	}
60
61
	@Override
62
	@SuppressWarnings("unchecked")
63
	public <P, V, T extends ConfigurationValueBuilder<P, V>> T newConfigurationValueBuilder(P parent, Class<V> valueClass) {
64 18 1. lambda$newConfigurationValueBuilder$0 : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → NO_COVERAGE
2. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → NO_COVERAGE
3. lambda$newConfigurationValueBuilder$0 : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED
4. lambda$newConfigurationValueBuilder$0 : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED
5. lambda$newConfigurationValueBuilder$0 : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED
6. lambda$newConfigurationValueBuilder$0 : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED
7. lambda$newConfigurationValueBuilder$0 : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED
8. lambda$newConfigurationValueBuilder$0 : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED
9. lambda$newConfigurationValueBuilder$0 : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED
10. lambda$newConfigurationValueBuilder$0 : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED
11. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
12. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
13. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
14. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
15. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
16. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
17. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
18. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
		return newConfigurationValueBuilder(ctx -> (T) new ConfigurationValueBuilderHelper<>(parent, valueClass, ctx));
65
	}
66
67
	@Override
68
	public <P, V, T extends ConfigurationValueBuilder<P, V>> T newConfigurationValueBuilder(Function<BuildContext, T> factory) {
69 9 1. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → NO_COVERAGE
2. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
3. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
4. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
5. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
6. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
7. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
8. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
9. newConfigurationValueBuilder : replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED
		return factory.apply(this);
70
	}
71
72
}

Mutations

43

1.1
Location : register
Killed by : oghamfremarker.it.FreeMarkerParserTest.nested(oghamfremarker.it.FreeMarkerParserTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED

2.2
Location : register
Killed by : oghamthymeleafv2.it.ThymeleafDetectorTest.notFound(oghamthymeleafv2.it.ThymeleafDetectorTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED

3.3
Location : register
Killed by : oghamthymeleafv3.it.ThymeleafDetectorTest.notFound(oghamthymeleafv3.it.ThymeleafDetectorTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED

4.4
Location : register
Killed by : oghamcore.it.core.builder.TemplatePrioritySpec
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED

5.5
Location : register
Killed by : oghamcloudhopper.it.PartialConfigurationTest.splitterEnabledButAutoGuessNotEnabledAndNoEncodingConfiguredAndLongMessageShouldFailIndicatingThatNoSplitterIsConfigured(oghamcloudhopper.it.PartialConfigurationTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED

6.6
Location : register
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → NO_COVERAGE

7.7
Location : register
Killed by : oghamjavamail.it.JavaMailSmtpTest.missingRecipientIsInvalid(oghamjavamail.it.JavaMailSmtpTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED

8.8
Location : register
Killed by : oghamall.it.sms.message.addressing.translator.ReceiverPhoneNumberTranslatorTest.translateNull(oghamall.it.sms.message.addressing.translator.ReceiverPhoneNumberTranslatorTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED

9.9
Location : register
Killed by : oghamovh.it.OvhSmsTest.nationalNumber(oghamovh.it.OvhSmsTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::register → KILLED

48

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

2.2
Location : evaluate
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::evaluate → TIMED_OUT

3.3
Location : evaluate
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::evaluate → SURVIVED

53

1.1
Location : getPropertyResolver
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::getPropertyResolver → SURVIVED

2.2
Location : getPropertyResolver
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::getPropertyResolver → NO_COVERAGE

3.3
Location : getPropertyResolver
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::getPropertyResolver → TIMED_OUT

4.4
Location : getPropertyResolver
Killed by : oghamjavamail.it.JavaMailSmtpTest.missingRecipientIsInvalid(oghamjavamail.it.JavaMailSmtpTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::getPropertyResolver → KILLED

58

1.1
Location : getConverter
Killed by : oghamjavamail.it.JavaMailStructureTest.plainTextBody(oghamjavamail.it.JavaMailStructureTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::getConverter → KILLED

2.2
Location : getConverter
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::getConverter → NO_COVERAGE

64

1.1
Location : lambda$newConfigurationValueBuilder$0
Killed by : oghamjavamail.it.JavaMailSmtpTest.missingRecipientIsInvalid(oghamjavamail.it.JavaMailSmtpTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED

2.2
Location : lambda$newConfigurationValueBuilder$0
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → NO_COVERAGE

3.3
Location : lambda$newConfigurationValueBuilder$0
Killed by : oghamall.it.sms.message.addressing.translator.ReceiverPhoneNumberTranslatorTest.translateNull(oghamall.it.sms.message.addressing.translator.ReceiverPhoneNumberTranslatorTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED

4.4
Location : lambda$newConfigurationValueBuilder$0
Killed by : oghamcloudhopper.it.PartialConfigurationTest.splitterEnabledButAutoGuessNotEnabledAndNoEncodingConfiguredAndLongMessageShouldFailIndicatingThatNoSplitterIsConfigured(oghamcloudhopper.it.PartialConfigurationTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED

5.5
Location : lambda$newConfigurationValueBuilder$0
Killed by : oghamthymeleafv2.it.ThymeleafDetectorTest.notFound(oghamthymeleafv2.it.ThymeleafDetectorTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED

6.6
Location : lambda$newConfigurationValueBuilder$0
Killed by : oghamfremarker.it.FreeMarkerParserTest.nested(oghamfremarker.it.FreeMarkerParserTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED

7.7
Location : lambda$newConfigurationValueBuilder$0
Killed by : oghamthymeleafv3.it.ThymeleafDetectorTest.notFound(oghamthymeleafv3.it.ThymeleafDetectorTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED

8.8
Location : lambda$newConfigurationValueBuilder$0
Killed by : oghamovh.it.SmsCodingTest.smsCodingFromInvalidValue(oghamovh.it.SmsCodingTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED

9.9
Location : lambda$newConfigurationValueBuilder$0
Killed by : oghamcore.it.core.builder.retry.RetryBuilderSpec
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::lambda$newConfigurationValueBuilder$0 → KILLED

10.10
Location : newConfigurationValueBuilder
Killed by : oghamall.it.sms.message.addressing.translator.ReceiverPhoneNumberTranslatorTest.translateNull(oghamall.it.sms.message.addressing.translator.ReceiverPhoneNumberTranslatorTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

11.11
Location : newConfigurationValueBuilder
Killed by : oghamcore.it.core.builder.retry.RetryBuilderSpec
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

12.12
Location : newConfigurationValueBuilder
Killed by : oghamjavamail.it.JavaMailSmtpTest.missingRecipientIsInvalid(oghamjavamail.it.JavaMailSmtpTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

13.13
Location : newConfigurationValueBuilder
Killed by : oghamovh.it.SmsCodingTest.smsCodingFromInvalidValue(oghamovh.it.SmsCodingTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

14.14
Location : newConfigurationValueBuilder
Killed by : oghamcloudhopper.it.PartialConfigurationTest.splitterEnabledButAutoGuessNotEnabledAndNoEncodingConfiguredAndLongMessageShouldFailIndicatingThatNoSplitterIsConfigured(oghamcloudhopper.it.PartialConfigurationTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

15.15
Location : newConfigurationValueBuilder
Killed by : oghamthymeleafv3.it.ThymeleafDetectorTest.notFound(oghamthymeleafv3.it.ThymeleafDetectorTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

16.16
Location : newConfigurationValueBuilder
Killed by : oghamthymeleafv2.it.ThymeleafDetectorTest.notFound(oghamthymeleafv2.it.ThymeleafDetectorTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

17.17
Location : newConfigurationValueBuilder
Killed by : oghamfremarker.it.FreeMarkerParserTest.nested(oghamfremarker.it.FreeMarkerParserTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

18.18
Location : newConfigurationValueBuilder
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → NO_COVERAGE

69

1.1
Location : newConfigurationValueBuilder
Killed by : oghamfremarker.it.FreeMarkerParserTest.nested(oghamfremarker.it.FreeMarkerParserTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

2.2
Location : newConfigurationValueBuilder
Killed by : oghamthymeleafv2.it.ThymeleafDetectorTest.notFound(oghamthymeleafv2.it.ThymeleafDetectorTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

3.3
Location : newConfigurationValueBuilder
Killed by : oghamovh.it.SmsCodingTest.smsCodingFromInvalidValue(oghamovh.it.SmsCodingTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

4.4
Location : newConfigurationValueBuilder
Killed by : oghamcloudhopper.it.PartialConfigurationTest.splitterEnabledButAutoGuessNotEnabledAndNoEncodingConfiguredAndLongMessageShouldFailIndicatingThatNoSplitterIsConfigured(oghamcloudhopper.it.PartialConfigurationTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

5.5
Location : newConfigurationValueBuilder
Killed by : oghamthymeleafv3.it.ThymeleafDetectorTest.notFound(oghamthymeleafv3.it.ThymeleafDetectorTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

6.6
Location : newConfigurationValueBuilder
Killed by : oghamjavamail.it.JavaMailSmtpTest.missingRecipientIsInvalid(oghamjavamail.it.JavaMailSmtpTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

7.7
Location : newConfigurationValueBuilder
Killed by : oghamcore.it.core.builder.retry.RetryBuilderSpec
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

8.8
Location : newConfigurationValueBuilder
Killed by : oghamall.it.sms.message.addressing.translator.ReceiverPhoneNumberTranslatorTest.translateNull(oghamall.it.sms.message.addressing.translator.ReceiverPhoneNumberTranslatorTest)
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → KILLED

9.9
Location : newConfigurationValueBuilder
Killed by : none
replaced return value with null for fr/sii/ogham/core/builder/context/DefaultBuildContext::newConfigurationValueBuilder → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT OGHAM