package com.grayben.riskExtractor.htmlScorer.nodeVisitor.setup.container;

import com.grayben.riskExtractor.htmlScorer.ScoredText;
import com.grayben.riskExtractor.htmlScorer.nodeVisitor.setup.annotation.AnnotatedElement;
import com.grayben.riskExtractor.htmlScorer.partScorers.elementScorers.ElementScorerSetFunction;
import com.grayben.tools.testOracle.testContainer.TestContainer;

import java.util.Set;
import java.util.function.Function;

/**
 * For a nominated test configuration: generates the test input, SUT and expected output.
 * <p>
 *
 */
public class TestContainerFunction implements Function<Set<ElementScorerSetFunction.Content>, TestContainer<AnnotatedElement, ScoredText>> {

    private final SystemUnderTestFunction systemUnderTestFunction;
    private final ActiveOracleSupplier activeOracleSupplier;
    private final ElementScorerSetFunction elementScorerSetFunction;

    public TestContainerFunction() {
        this.systemUnderTestFunction = new SystemUnderTestFunction();
        this.activeOracleSupplier = new ActiveOracleSupplier();
        elementScorerSetFunction = new ElementScorerSetFunction();
    }

    @Override
    public TestContainer<AnnotatedElement, ScoredText> apply(Set<ElementScorerSetFunction.Content> contents) {

        return new TestContainer.Builder<AnnotatedElement, ScoredText>()
                .begin()
                .systemUnderTest(systemUnderTestFunction.apply(elementScorerSetFunction.apply(contents)))
                .oracle(activeOracleSupplier.get())
                .build();

    }
}
@@ -215,16 +215,80 @@
 lement;%0A
+import com.grayben.riskExtractor.htmlScorer.partScorers.Scorer;%0A
 import c
@@ -432,32 +432,64 @@
 r.TestContainer;
+%0Aimport org.jsoup.nodes.Element;
 %0A%0Aimport java.ut
@@ -704,41 +704,24 @@
 Set%3C
-ElementScorerSetFunction.Cont
+Scorer%3CElem
 ent%3E
+%3E
 , Te
@@ -1292,50 +1292,41 @@
 Set%3C
-ElementScorerSetFunction.Content%3E contents
+Scorer%3CElement%3E%3E elementScorerSet
 ) %7B%0A
@@ -1507,32 +1507,8 @@
 rSet
-Function.apply(contents)
 ))%0A 

Refactor signature of TestContainerFunction