{#- Java test method template for JUnit 5
Context variables:
- method_name: method name (UpperCamelCase)
- description: fixture description
- builder_expressions: string containing pre-generated builder expressions (or empty)
- setup_lines: list of setup line strings (e.g., handle creation)
- throws_clause: " throws Exception" or ""
- expects_error: boolean
- call_expr: the complete function call expression
- result_var: result variable name
- assertions_body: string containing all rendered assertions
#}
@Test
void test{{ method_name }}(){{ throws_clause }} {
// {{ description }}
{% if builder_expressions %}
{{ builder_expressions }}
{% endif %}
{% for line in setup_lines %}
{{ line }}
{% endfor %}
{% if expects_error %}
assertThrows(Exception.class, () -> {{ call_expr }});
{% else %}
var {{ result_var }} = {{ call_expr }};
{{ assertions_body }}
{% endif %}
}