Package io.quarkus.qute
Class RenderedResults
java.lang.Object
io.quarkus.qute.RenderedResults
- All Implemented Interfaces:
Iterable<Map.Entry<String,,List<RenderedResults.RenderedResult>>> BiConsumer<TemplateInstance,String>
public class RenderedResults
extends Object
implements BiConsumer<TemplateInstance,String>, Iterable<Map.Entry<String,List<RenderedResults.RenderedResult>>>
This helper class can be used to collect rendering results and assert the results in a test.
You can obtain the results for a specific template with getResults(String). This class also implements iterable -
the entry key is the template id and the value is a copy of the list of all results. Finally, it's also possible to filter
the results with setFilter(BiPredicate) and remove some results with remove(Predicate).
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(TemplateInstance templateInstance, String result) voidclear()Remove all results.getResults(String templateId) The returned list is an immutable copy of the results for the given template id.iterator()voidremove(Predicate<RenderedResults.RenderedResult> predicate) Remove all results that match the given predicate.voidOnly results that match the given predicate are stored.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.function.BiConsumer
andThenMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
RenderedResults
public RenderedResults() -
RenderedResults
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceBiConsumer<TemplateInstance,String>
-
getResults
The returned list is an immutable copy of the results for the given template id.For fragments the template id is the template id of the original template followed by the
$and the name of the fragment.- Parameters:
templateId-- Returns:
- the results for the given template id
- See Also:
-
iterator
-
clear
public void clear()Remove all results. -
remove
Remove all results that match the given predicate.- Parameters:
predicate-
-
setFilter
Only results that match the given predicate are stored.- Parameters:
filter-
-
toString
-