PduRequestWithContext.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
import fr.sii.ogham.testing.sms.simulator.bean.SubmitSm;
8
9
/**
10
 * Dedicated context for one particular {@link SubmitSm}
11
 * 
12
 * @author Aurélien Baudet
13
 *
14
 * @param <S>
15
 *            the type of {@link SubmitSm}
16
 */
17
public class PduRequestWithContext<S extends SubmitSm> implements Context {
18
	private final S request;
19
	private final String name;
20
	private final Context parent;
21
22
	/**
23
	 * @param request
24
	 *            the received request
25
	 * @param name
26
	 *            a name used in context evaluation
27
	 * @param parent
28
	 *            the parent context
29
	 */
30
	public PduRequestWithContext(S request, String name, Context parent) {
31
		super();
32
		this.request = request;
33
		this.name = name;
34
		this.parent = parent;
35
	}
36
37
	@Override
38
	public String evaluate(String template) {
39
		String result = template.replaceAll(quote("${name}"), quoteReplacement(name));
40 3 1. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/sms/PduRequestWithContext::evaluate → NO_COVERAGE
2. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/sms/PduRequestWithContext::evaluate → SURVIVED
3. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/sms/PduRequestWithContext::evaluate → KILLED
		return parent.evaluate(result);
41
	}
42
43
	/**
44
	 * @return the received request
45
	 */
46
	public S getRequest() {
47 4 1. getRequest : replaced return value with null for fr/sii/ogham/testing/assertion/sms/PduRequestWithContext::getRequest → NO_COVERAGE
2. getRequest : replaced return value with null for fr/sii/ogham/testing/assertion/sms/PduRequestWithContext::getRequest → KILLED
3. getRequest : replaced return value with null for fr/sii/ogham/testing/assertion/sms/PduRequestWithContext::getRequest → KILLED
4. getRequest : replaced return value with null for fr/sii/ogham/testing/assertion/sms/PduRequestWithContext::getRequest → KILLED
		return request;
48
	}
49
50
}

Mutations

40

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

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

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

47

1.1
Location : getRequest
Killed by : oghamall.it.sms.SmsSMPPDefaultsTest.gsm8bitDefaultAlphabet(oghamall.it.sms.SmsSMPPDefaultsTest)
replaced return value with null for fr/sii/ogham/testing/assertion/sms/PduRequestWithContext::getRequest → KILLED

2.2
Location : getRequest
Killed by : oghamtesting.it.assertion.FluentSmsAssertionsSpec
replaced return value with null for fr/sii/ogham/testing/assertion/sms/PduRequestWithContext::getRequest → KILLED

3.3
Location : getRequest
Killed by : none
replaced return value with null for fr/sii/ogham/testing/assertion/sms/PduRequestWithContext::getRequest → NO_COVERAGE

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

Active mutators

Tests examined


Report generated by PIT OGHAM