FileResolverAdapter.java

1
package fr.sii.ogham.template.thymeleaf.common.adapter;
2
3
import org.thymeleaf.templateresolver.FileTemplateResolver;
4
import org.thymeleaf.templateresolver.ITemplateResolver;
5
6
import fr.sii.ogham.core.resource.resolver.DelegateResourceResolver;
7
import fr.sii.ogham.core.resource.resolver.ResourceResolver;
8
9
/**
10
 * Adapter that converts general
11
 * {@link fr.sii.ogham.core.resource.resolver.FileResolver} into Thymeleaf
12
 * specific {@link FileTemplateResolver}.
13
 * 
14
 * @author Aurélien Baudet
15
 *
16
 */
17
public class FileResolverAdapter extends AbstractTemplateResolverOptionsAdapter {
18
19
	public FileResolverAdapter(TemplateResolverOptionsApplier optionsSetter) {
20
		super(optionsSetter);
21
	}
22
23
	@Override
24
	public boolean supports(ResourceResolver resolver) {
25 4 1. supports : negated conditional → NO_COVERAGE
2. supports : negated conditional → KILLED
3. supports : negated conditional → KILLED
4. supports : negated conditional → KILLED
		ResourceResolver actualResolver = resolver instanceof DelegateResourceResolver ? ((DelegateResourceResolver) resolver).getActualResourceResolver() : resolver;
26 8 1. supports : replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → NO_COVERAGE
2. supports : replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → NO_COVERAGE
3. supports : replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → KILLED
4. supports : replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → KILLED
5. supports : replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → KILLED
6. supports : replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → KILLED
7. supports : replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → KILLED
8. supports : replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → KILLED
		return actualResolver instanceof fr.sii.ogham.core.resource.resolver.FileResolver;
27
	}
28
29
	@Override
30
	public ITemplateResolver adapt(ResourceResolver resolver) {
31
		FileTemplateResolver templateResolver = new FileTemplateResolver();
32 4 1. adapt : removed call to fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::applyOptions → SURVIVED
2. adapt : removed call to fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::applyOptions → NO_COVERAGE
3. adapt : removed call to fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::applyOptions → KILLED
4. adapt : removed call to fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::applyOptions → KILLED
		applyOptions(templateResolver);
33 4 1. adapt : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::adapt → NO_COVERAGE
2. adapt : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::adapt → KILLED
3. adapt : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::adapt → KILLED
4. adapt : replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::adapt → KILLED
		return templateResolver;
34
	}
35
36
}

Mutations

25

1.1
Location : supports
Killed by : oghamthymeleafv3.it.resolver.StringResourceResolverTest.text(oghamthymeleafv3.it.resolver.StringResourceResolverTest)
negated conditional → KILLED

2.2
Location : supports
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : supports
Killed by : oghamthymeleafv2.it.resolver.StringResourceResolverTest.text(oghamthymeleafv2.it.resolver.StringResourceResolverTest)
negated conditional → KILLED

4.4
Location : supports
Killed by : oghamall.it.email.FluentEmailTest.bodyTemplateString(oghamall.it.email.FluentEmailTest)
negated conditional → KILLED

26

1.1
Location : supports
Killed by : oghamall.it.email.ExternalFileTest.thymeleafHtmlFileFreemarkerTextFile(oghamall.it.email.ExternalFileTest)
replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → KILLED

2.2
Location : supports
Killed by : oghamthymeleafv3.it.ExternalFileTest.fileUnreadable(oghamthymeleafv3.it.ExternalFileTest)
replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → KILLED

3.3
Location : supports
Killed by : oghamthymeleafv2.it.ExternalFileTest.fileNotFound(oghamthymeleafv2.it.ExternalFileTest)
replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → KILLED

4.4
Location : supports
Killed by : none
replaced boolean return with false for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → NO_COVERAGE

5.5
Location : supports
Killed by : oghamthymeleafv2.it.resolver.StringResourceResolverTest.text(oghamthymeleafv2.it.resolver.StringResourceResolverTest)
replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → KILLED

6.6
Location : supports
Killed by : none
replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → NO_COVERAGE

7.7
Location : supports
Killed by : oghamthymeleafv3.it.resolver.StringResourceResolverTest.text(oghamthymeleafv3.it.resolver.StringResourceResolverTest)
replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → KILLED

8.8
Location : supports
Killed by : oghamall.it.email.FluentEmailTest.bodyTemplateString(oghamall.it.email.FluentEmailTest)
replaced boolean return with true for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::supports → KILLED

32

1.1
Location : adapt
Killed by : none
removed call to fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::applyOptions → SURVIVED

2.2
Location : adapt
Killed by : oghamthymeleafv2.it.ExternalFileTest.fileUpdatedWithoutThymeleafCache(oghamthymeleafv2.it.ExternalFileTest)
removed call to fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::applyOptions → KILLED

3.3
Location : adapt
Killed by : none
removed call to fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::applyOptions → NO_COVERAGE

4.4
Location : adapt
Killed by : oghamthymeleafv3.it.ExternalFileTest.fileUpdatedWithoutThymeleafCache(oghamthymeleafv3.it.ExternalFileTest)
removed call to fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::applyOptions → KILLED

33

1.1
Location : adapt
Killed by : none
replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::adapt → NO_COVERAGE

2.2
Location : adapt
Killed by : oghamthymeleafv3.it.ExternalFileTest.fileUnreadable(oghamthymeleafv3.it.ExternalFileTest)
replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::adapt → KILLED

3.3
Location : adapt
Killed by : oghamall.it.email.ExternalFileTest.thymeleafHtmlFileFreemarkerTextFile(oghamall.it.email.ExternalFileTest)
replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::adapt → KILLED

4.4
Location : adapt
Killed by : oghamthymeleafv2.it.ExternalFileTest.fileNotFound(oghamthymeleafv2.it.ExternalFileTest)
replaced return value with null for fr/sii/ogham/template/thymeleaf/common/adapter/FileResolverAdapter::adapt → KILLED

Active mutators

Tests examined


Report generated by PIT OGHAM