void (@NotNull String name, int offset, @NotNull String parentPropertyName) { final PsiElement resolve = GotoDeclarationAction.findTargetElement(getProject(), myFixture.getEditor(), offset); Assert.assertEquals("\"" + name + "\"", resolve.getText()); final PsiElement parent = resolve.getParent(); Assert.assertTrue(parent instanceof JsonProperty); Assert.assertEquals(name, ((JsonProperty)parent).getName()); Assert.assertTrue(parent.getParent().getParent() instanceof JsonProperty); final JsonProperty props = (JsonProperty)parent.getParent().getParent(); Assert.assertEquals("properties", props.getName()); final JsonProperty parentProperty = ObjectUtils.tryCast(props.getParent().getParent(), JsonProperty.class); Assert.assertNotNull(parentProperty); Assert.assertEquals(parentPropertyName, parentProperty.getName()); }