use of org.neo4j.kernel.impl.annotations.Documented in project neo4j by neo4j.
the class LabelsIT method removing_a_non_existent_label_from_a_node.
@Documented("Removing a non-existent label from a node.")
@Test
@GraphDescription.Graph(nodes = { @NODE(name = "Clint Eastwood", setNameProperty = true) })
public void removing_a_non_existent_label_from_a_node() throws PropertyValueException {
Map<String, Node> nodes = data.get();
Node node = nodes.get("Clint Eastwood");
String nodeUri = getNodeUri(node);
String labelName = "Person";
gen.get().expectedStatus(204).delete(nodeUri + "/labels/" + labelName);
assertThat(node, inTx(graphdb(), not(hasLabel(label(labelName)))));
}
use of org.neo4j.kernel.impl.annotations.Documented in project neo4j by neo4j.
the class LabelsIT method removing_a_label_from_a_node.
@Documented("Removing a label from a node.")
@Test
@GraphDescription.Graph(nodes = { @NODE(name = "Clint Eastwood", setNameProperty = true, labels = { @LABEL("Person") }) })
public void removing_a_label_from_a_node() throws PropertyValueException {
Map<String, Node> nodes = data.get();
Node node = nodes.get("Clint Eastwood");
String nodeUri = getNodeUri(node);
String labelName = "Person";
gen.get().expectedStatus(204).delete(nodeUri + "/labels/" + labelName);
assertThat(node, inTx(graphdb(), not(hasLabel(label(labelName)))));
}
use of org.neo4j.kernel.impl.annotations.Documented in project neo4j by neo4j.
the class RelationshipIT method shouldReturn404WhenPropertyWhichDoesNotExistRemovedFromRelationship.
@Test
@Title("Remove non-existent property from a relationship")
@Documented("Attempting to remove a property that doesn't exist results in an error.")
@Graph(nodes = { @NODE(name = "Romeo", setNameProperty = true), @NODE(name = "Juliet", setNameProperty = true) }, relationships = { @REL(start = "Romeo", end = "Juliet", type = "LOVES", properties = { @PROP(key = "cost", value = "high", type = GraphDescription.PropType.STRING) }) })
public void shouldReturn404WhenPropertyWhichDoesNotExistRemovedFromRelationship() {
data.get();
Relationship loves = getFirstRelationshipFromRomeoNode();
gen().expectedStatus(Status.NOT_FOUND.getStatusCode()).delete(getPropertiesUri(loves) + "/non-existent").entity();
}
use of org.neo4j.kernel.impl.annotations.Documented in project neo4j by neo4j.
the class RetrieveRelationshipsFromNodeIT method shouldRespondWith200AndListOfRelationshipRepresentationsWhenGettingAllRelationshipsForANode.
@Documented("Get all relationships.")
@Test
public void shouldRespondWith200AndListOfRelationshipRepresentationsWhenGettingAllRelationshipsForANode() throws JsonParseException {
String entity = gen.get().expectedStatus(200).get(functionalTestHelper.nodeUri() + "/" + nodeWithRelationships + "/relationships" + "/all").entity();
verifyRelReps(3, entity);
}
use of org.neo4j.kernel.impl.annotations.Documented in project neo4j by neo4j.
the class RetrieveNodeIT method shouldGet200WhenRetrievingNodeCompact.
@Documented("Get node -- compact.\n" + "\n" + "Specifying the subformat in the requests media type yields a more compact\n" + "JSON response without metadata and templates.")
@Test
public void shouldGet200WhenRetrievingNodeCompact() {
String uri = nodeUri.toString();
ResponseEntity entity = gen.get().expectedType(CompactJsonFormat.MEDIA_TYPE).expectedStatus(200).get(uri);
assertTrue(entity.entity().contains("self"));
}
Aggregations