I’m trying to create the live template that looks like this:
@org.testng.annotations.Test public void
$unit_of_work$_$state_under_test$_$expected_behavior$() {
// GIVEN
// WHEN
// THEN
}
My params:
Abbreviation: test
Description: TestNG test
Type java:declaration
When I call this template by “test” name, I want to see somethin like this:
@Test public void
unit_of_work_state_under_test_expected_behavior() {
// GIVEN
// WHEN
// THEN
}
And than override each variable (unit_of_work; state_under_test; expected_behavior)
Simply switching by using TAB key.
But instead I have something like this:
@Test public void
__() {
// GIVEN
// WHEN
// THEN
}
It doesn’t show var names (hints).
So I’m trying to figure out where my mistake is.
Any ideas?
When you edit your live template, click Edit variables. There you can define default values for your variables (the variables from your template should already be there).
Just fill out the Default value column. Make sure that the values are enclosed in double quotes (it is necessary if they are literal values), see the documentation.