SmsFiller.java

1
package fr.sii.ogham.sms.filler;
2
3
import java.util.Map;
4
5
import fr.sii.ogham.core.builder.configuration.ConfigurationValueBuilderHelper;
6
import fr.sii.ogham.core.filler.AbstractMessageAwareFiller;
7
import fr.sii.ogham.sms.message.Sms;
8
9
public class SmsFiller extends AbstractMessageAwareFiller<Sms> {
10
11
	public SmsFiller(Map<String, ConfigurationValueBuilderHelper<?, ?>> defaultValues) {
12
		super(defaultValues, Sms.class);
13
	}
14
15
	@Override
16
	protected void fill(Sms sms) {
17 2 1. fill : negated conditional → RUN_ERROR
2. fill : negated conditional → RUN_ERROR
		if(sms.getFrom()==null && containsProperty("from")) {
18
			sms.from(getProperty("from", String.class));
19
		}
20 2 1. fill : negated conditional → RUN_ERROR
2. fill : negated conditional → RUN_ERROR
		if(!hasRecipients(sms) && containsProperty("to")) {
21
			sms.to(getProperty("to", String[].class));
22
		}
23
	}
24
	
25
	private static boolean hasRecipients(Sms sms) {
26 3 1. hasRecipients : negated conditional → RUN_ERROR
2. hasRecipients : replaced boolean return with true for fr/sii/ogham/sms/filler/SmsFiller::hasRecipients → RUN_ERROR
3. hasRecipients : negated conditional → RUN_ERROR
		return sms.getRecipients()!=null && !sms.getRecipients().isEmpty();
27
	}
28
}

Mutations

17

1.1
Location : fill
Killed by :
negated conditional → RUN_ERROR

2.2
Location : fill
Killed by :
negated conditional → RUN_ERROR

20

1.1
Location : fill
Killed by :
negated conditional → RUN_ERROR

2.2
Location : fill
Killed by :
negated conditional → RUN_ERROR

26

1.1
Location : hasRecipients
Killed by :
negated conditional → RUN_ERROR

2.2
Location : hasRecipients
Killed by :
replaced boolean return with true for fr/sii/ogham/sms/filler/SmsFiller::hasRecipients → RUN_ERROR

3.3
Location : hasRecipients
Killed by :
negated conditional → RUN_ERROR

Active mutators

Tests examined


Report generated by PIT 1.13.1