You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I currently struggle with creating the variables hat should be used to fill the templates from the surrounding java JUnit code.
I know I can do it from within the thtest-file but that is not a viable solution as the context contains multiple aggregated objects.
Is there an intended way to do so? If not, i would like to request it.
I already asked this on stackoverflow some time ago but did no receive any response or solution to it.
The text was updated successfully, but these errors were encountered:
`public class WebProcessingContextBuilderWithJavaVariables extends WebProcessingContextBuilder {
private final Map<String, Object> vars;
public WebProcessingContextBuilderWithJavaVariables(Map<String, Object> variables) {
vars = variables;
}
@Override
protected void doAdditionalVariableProcessing(
final ITest test,
final HttpServletRequest request, final HttpServletResponse response, final ServletContext servletContext,
final Locale locale, final Map<String, Object> variables) {
variables.putAll(vars);
}
}
@test
void someTest() {
HashMap<String, Object> vars = new HashMap<>();
vars.put("key", validations);
executor.setProcessingContextBuilder(new WebProcessingContextBuilderWithJavaVariables(vars));
executor.execute("classpath:template.thtest");
Hey,
I currently struggle with creating the variables hat should be used to fill the templates from the surrounding java JUnit code.
I know I can do it from within the thtest-file but that is not a viable solution as the context contains multiple aggregated objects.
Is there an intended way to do so? If not, i would like to request it.
I already asked this on stackoverflow some time ago but did no receive any response or solution to it.
The text was updated successfully, but these errors were encountered: