void (String expected) { RestGotoProvider provider = new RestGotoProvider(); final String path = "/goto/" + getTestName(true); myFixture.configureByFile(path + ".rst"); int e = myFixture.getCaretOffset(); PsiElement result = provider.getGotoDeclarationTarget(myFixture.getFile().findElementAt(e), myFixture.getEditor()); assertNotNull(result); assertEquals(expected, result.getText()); }