PhoneNumberWithContext.java

1
package fr.sii.ogham.testing.assertion.sms;
2
3
import static java.util.regex.Matcher.quoteReplacement;
4
import static java.util.regex.Pattern.quote;
5
6
import fr.sii.ogham.testing.assertion.context.Context;
7
8
/**
9
 * Context dedicated to a phone number of a particular message.
10
 * 
11
 * @author Aurélien Baudet
12
 *
13
 */
14
public class PhoneNumberWithContext implements Context {
15
	private final PhoneNumberInfo number;
16
	private final String name;
17
	private final Context parent;
18
19
	/**
20
	 * @param number
21
	 *            the phone number
22
	 * @param name
23
	 *            a name to identify it in the context (sender or receiver)
24
	 * @param parent
25
	 *            the parent context
26
	 */
27
	public PhoneNumberWithContext(PhoneNumberInfo number, String name, Context parent) {
28
		super();
29
		this.number = number;
30
		this.name = name;
31
		this.parent = parent;
32
	}
33
34
	@Override
35
	public String evaluate(String template) {
36
		String result = template.replaceAll(quote("${numberName}"), quoteReplacement(name));
37 3 1. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::evaluate → NO_COVERAGE
2. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::evaluate → SURVIVED
3. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::evaluate → KILLED
		return parent.evaluate(result);
38
	}
39
40
	/**
41
	 * @return the phone number
42
	 */
43
	public PhoneNumberInfo getNumber() {
44 4 1. getNumber : replaced return value with null for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::getNumber → NO_COVERAGE
2. getNumber : replaced return value with null for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::getNumber → KILLED
3. getNumber : replaced return value with null for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::getNumber → KILLED
4. getNumber : replaced return value with null for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::getNumber → KILLED
		return number;
45
	}
46
}

Mutations

37

1.1
Location : evaluate
Killed by : oghamtesting.it.assertion.FluentSmsAssertionsSpec
replaced return value with "" for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::evaluate → KILLED

2.2
Location : evaluate
Killed by : none
replaced return value with "" for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::evaluate → NO_COVERAGE

3.3
Location : evaluate
Killed by : none
replaced return value with "" for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::evaluate → SURVIVED

44

1.1
Location : getNumber
Killed by : oghamcloudhopper.it.PartialConfigurationTest.nothingConfiguredAndLongMessageShouldSendOneLongMessageUsingDefaultEncoding(oghamcloudhopper.it.PartialConfigurationTest)
replaced return value with null for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::getNumber → KILLED

2.2
Location : getNumber
Killed by : none
replaced return value with null for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::getNumber → NO_COVERAGE

3.3
Location : getNumber
Killed by : oghamtesting.it.assertion.FluentSmsAssertionsSpec
replaced return value with null for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::getNumber → KILLED

4.4
Location : getNumber
Killed by : oghamall.it.sms.SmsSMPPGsm7bitTest.longMessage(oghamall.it.sms.SmsSMPPGsm7bitTest)
replaced return value with null for fr/sii/ogham/testing/assertion/sms/PhoneNumberWithContext::getNumber → KILLED

Active mutators

Tests examined


Report generated by PIT OGHAM