AddressesWithContext.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 java.util.List;
7
8
import javax.mail.internet.InternetAddress;
9
10
import fr.sii.ogham.testing.assertion.context.Context;
11
12
public class AddressesWithContext implements Context {
13
	private final List<InternetAddress> addresses;
14
	private final String field;
15
	private final Context parent;
16
	
17
	public AddressesWithContext(List<InternetAddress> addresses, String field, Context parent) {
18
		super();
19
		this.addresses = addresses;
20
		this.field = field;
21
		this.parent = parent;
22
	}
23
	
24
	public String evaluate(String template) {
25
		String result = template.replaceAll(quote("${fieldName}"), quoteReplacement(field));
26 3 1. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/email/AddressesWithContext::evaluate → SURVIVED
2. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/email/AddressesWithContext::evaluate → NO_COVERAGE
3. evaluate : replaced return value with "" for fr/sii/ogham/testing/assertion/email/AddressesWithContext::evaluate → KILLED
		return parent.evaluate(result);
27
	}
28
	
29
	public List<InternetAddress> getAddresses() {
30 4 1. getAddresses : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/email/AddressesWithContext::getAddresses → NO_COVERAGE
2. getAddresses : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/email/AddressesWithContext::getAddresses → KILLED
3. getAddresses : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/email/AddressesWithContext::getAddresses → KILLED
4. getAddresses : replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/email/AddressesWithContext::getAddresses → KILLED
		return addresses;
31
	}
32
	
33
}

Mutations

26

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

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

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

30

1.1
Location : getAddresses
Killed by : oghamjavamail.it.JavaMailSmtpTest.simple(oghamjavamail.it.JavaMailSmtpTest)
replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/email/AddressesWithContext::getAddresses → KILLED

2.2
Location : getAddresses
Killed by : oghamall.it.configuration.EmptyBuilderTest.manualJavaMailConfigurationCanSendEmail(oghamall.it.configuration.EmptyBuilderTest)
replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/email/AddressesWithContext::getAddresses → KILLED

3.3
Location : getAddresses
Killed by : oghamtesting.it.assertion.FluentEmailAssertionsSpec
replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/email/AddressesWithContext::getAddresses → KILLED

4.4
Location : getAddresses
Killed by : none
replaced return value with Collections.emptyList for fr/sii/ogham/testing/assertion/email/AddressesWithContext::getAddresses → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT OGHAM