PartWithContext.java

1
package fr.sii.ogham.testing.assertion.email;
2
3
import static java.util.regex.Matcher.quoteReplacement;
4
import static java.util.regex.Pattern.quote;
5
6
import javax.mail.Part;
7
8
import fr.sii.ogham.testing.assertion.context.Context;
9
10
public class PartWithContext implements Context {
11
	private final Part part;
12
	private final String partName;
13
	private final Context parent;
14
	public PartWithContext(Part part, String partName, Context parent) {
15
		super();
16
		this.part = part;
17
		this.partName = partName;
18
		this.parent = parent;
19
	}
20
	
21
	public String evaluate(String template) {
22
		String result = template.replaceAll(quote("${partName}"), quoteReplacement(partName));
23 4 1. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/email/PartWithContext::evaluate → SURVIVED
2. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/email/PartWithContext::evaluate → NO_COVERAGE
3. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/email/PartWithContext::evaluate → TIMED_OUT
4. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/email/PartWithContext::evaluate → KILLED
		return parent.evaluate(result);
24
	}
25
	
26
	public Part getPart() {
27 5 1. getPart : replaced return value with null for fr/sii/ogham/testing/assertion/email/PartWithContext::getPart → NO_COVERAGE
2. getPart : replaced return value with null for fr/sii/ogham/testing/assertion/email/PartWithContext::getPart → TIMED_OUT
3. getPart : replaced return value with null for fr/sii/ogham/testing/assertion/email/PartWithContext::getPart → KILLED
4. getPart : replaced return value with null for fr/sii/ogham/testing/assertion/email/PartWithContext::getPart → KILLED
5. getPart : replaced return value with null for fr/sii/ogham/testing/assertion/email/PartWithContext::getPart → KILLED
		return part;
28
	}
29
}

Mutations

23

1.1
Location : evaluate
Killed by : none
replaced return value with "" for fr/sii/ogham/testing/assertion/email/PartWithContext::evaluate → SURVIVED

2.2
Location : evaluate
Killed by : none
replaced return value with "" for fr/sii/ogham/testing/assertion/email/PartWithContext::evaluate → TIMED_OUT

3.3
Location : evaluate
Killed by : none
replaced return value with "" for fr/sii/ogham/testing/assertion/email/PartWithContext::evaluate → NO_COVERAGE

4.4
Location : evaluate
Killed by : oghamtesting.it.assertion.FluentEmailAssertionsSpec
replaced return value with "" for fr/sii/ogham/testing/assertion/email/PartWithContext::evaluate → KILLED

27

1.1
Location : getPart
Killed by : oghamtesting.it.assertion.FluentEmailAssertionsSpec
replaced return value with null for fr/sii/ogham/testing/assertion/email/PartWithContext::getPart → KILLED

2.2
Location : getPart
Killed by : none
replaced return value with null for fr/sii/ogham/testing/assertion/email/PartWithContext::getPart → TIMED_OUT

3.3
Location : getPart
Killed by : none
replaced return value with null for fr/sii/ogham/testing/assertion/email/PartWithContext::getPart → NO_COVERAGE

4.4
Location : getPart
Killed by : oghamall.it.configuration.EmptyBuilderTest.manualJavaMailConfigurationCanSendEmail(oghamall.it.configuration.EmptyBuilderTest)
replaced return value with null for fr/sii/ogham/testing/assertion/email/PartWithContext::getPart → KILLED

5.5
Location : getPart
Killed by : oghamjavamail.it.JavaMailSmtpTest.simple(oghamjavamail.it.JavaMailSmtpTest)
replaced return value with null for fr/sii/ogham/testing/assertion/email/PartWithContext::getPart → KILLED

Active mutators

Tests examined


Report generated by PIT OGHAM