void (@NotNull String text) { CustomFileTemplate template = new CustomFileTemplate("foo", "txt"); template.setText(text); template.setLiveTemplateEnabled(true); myFixture.testAction(new TestAction(template)); VirtualFile[] files = FileEditorManager.getInstance(getProject()).getSelectedFiles(); myFixture.openFileInEditor(files[0]); }