ActivableAtRuntimeConditionProvider.java

1
package fr.sii.ogham.core.condition.provider;
2
3
import fr.sii.ogham.core.builder.ActivableAtRuntime;
4
import fr.sii.ogham.core.condition.Condition;
5
import fr.sii.ogham.core.condition.FixedCondition;
6
import fr.sii.ogham.core.message.Message;
7
8
/**
9
 * If the source object implements {@link ActivableAtRuntime}, then this
10
 * provider returns directly the condition of
11
 * {@link ActivableAtRuntime#getCondition()}.
12
 * 
13
 * <p>
14
 * If the object doesn't implement {@link ActivableAtRuntime}, then returns a
15
 * condition that is always true.
16
 * </p>
17
 * 
18
 * @author Aurélien Baudet
19
 *
20
 */
21
public class ActivableAtRuntimeConditionProvider implements ConditionProvider<Object, Message> {
22
23
	@Override
24
	public Condition<Message> provide(Object source) {
25 8 1. provide : negated conditional → NO_COVERAGE
2. provide : negated conditional → KILLED
3. provide : negated conditional → KILLED
4. provide : negated conditional → KILLED
5. provide : negated conditional → KILLED
6. provide : negated conditional → KILLED
7. provide : negated conditional → KILLED
8. provide : negated conditional → KILLED
		if (source instanceof ActivableAtRuntime) {
26 5 1. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → NO_COVERAGE
2. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED
3. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED
4. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED
5. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED
			return ((ActivableAtRuntime) source).getCondition();
27
		}
28 7 1. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → NO_COVERAGE
2. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → SURVIVED
3. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → TIMED_OUT
4. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED
5. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED
6. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED
7. provide : replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED
		return new FixedCondition<>(true);
29
	}
30
31
}

Mutations

25

1.1
Location : provide
Killed by : oghamspringbootv1autoconfigure.it.SpringBeanResolutionTest.missingBeanErrorUsingThymeleaf(oghamspringbootv1autoconfigure.it.SpringBeanResolutionTest)
negated conditional → KILLED

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

3.3
Location : provide
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : provide
Killed by : oghamsmsglobal.it.SmsglobalServiceProviderConfigurerSpec
negated conditional → KILLED

5.5
Location : provide
Killed by : oghamspringbootv2autoconfigure.it.StaticMethodAccessTest.emailUsingFreemarkerTemplateAndStaticMethodAccessDisabledShouldFail(oghamspringbootv2autoconfigure.it.StaticMethodAccessTest)
negated conditional → KILLED

6.6
Location : provide
Killed by : oghamcore.it.core.service.CleanupTest.manualCleanupShouldAutomaticallyCleanTheSenders(oghamcore.it.core.service.CleanupTest)
negated conditional → KILLED

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

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

26

1.1
Location : provide
Killed by : oghamspringbootv2autoconfigure.it.StaticMethodAccessTest.emailUsingFreemarkerTemplateAndStaticMethodAccessDisabledShouldFail(oghamspringbootv2autoconfigure.it.StaticMethodAccessTest)
replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED

2.2
Location : provide
Killed by : oghamspringbootv1autoconfigure.it.SpringBeanResolutionTest.missingBeanErrorUsingThymeleaf(oghamspringbootv1autoconfigure.it.SpringBeanResolutionTest)
replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED

3.3
Location : provide
Killed by : oghamall.it.configuration.EmptyBuilderTest.emailSenderManuallyRegisteredButUnconfiguredTemplateParsersCantHandleMultiTemplateContent(oghamall.it.configuration.EmptyBuilderTest)
replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED

4.4
Location : provide
Killed by : none
replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → NO_COVERAGE

5.5
Location : provide
Killed by : oghamjavamail.it.builder.JavaMailCustomConfigurationTest.noHostDefinedShouldFail(oghamjavamail.it.builder.JavaMailCustomConfigurationTest)
replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED

28

1.1
Location : provide
Killed by : none
replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → NO_COVERAGE

2.2
Location : provide
Killed by : oghamcore.it.core.service.CleanupTest.manualCleanupShouldAutomaticallyCleanTheSenders(oghamcore.it.core.service.CleanupTest)
replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED

3.3
Location : provide
Killed by : oghamspringbootv1autoconfigure.it.SpringBeanResolutionTest.smsUsingFreemarkerTemplateShouldResolveBeans(oghamspringbootv1autoconfigure.it.SpringBeanResolutionTest)
replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED

4.4
Location : provide
Killed by : oghamall.it.sms.SmsCustomImplTest.simple(oghamall.it.sms.SmsCustomImplTest)
replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED

5.5
Location : provide
Killed by : oghamcloudhopper.it.AutoRetryExtensionTest.smsNotRetriedDueToCloudhopperError(oghamcloudhopper.it.AutoRetryExtensionTest)
replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → KILLED

6.6
Location : provide
Killed by : none
replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → SURVIVED

7.7
Location : provide
Killed by : none
replaced return value with null for fr/sii/ogham/core/condition/provider/ActivableAtRuntimeConditionProvider::provide → TIMED_OUT

Active mutators

Tests examined


Report generated by PIT OGHAM