use of org.neo4j.server.database.WrappedDatabase in project neo4j by neo4j.
the class DatabaseMetadataServiceTest method shouldAdvertiseRelationshipTypesThatCurrentlyExistInTheDatabase.
@Test
public void shouldAdvertiseRelationshipTypesThatCurrentlyExistInTheDatabase() throws Throwable {
try (Transaction tx = db.beginTx()) {
db.getRelationshipById(relId).delete();
tx.success();
}
Database database = new WrappedDatabase(db);
DatabaseMetadataService service = new DatabaseMetadataService(database);
try (Transaction tx = db.beginTx()) {
Response response = service.getRelationshipTypes(false);
assertEquals(200, response.getStatus());
List<Map<String, Object>> jsonList = JsonHelper.jsonToList(response.getEntity().toString());
assertEquals(3, jsonList.size());
}
database.stop();
}
use of org.neo4j.server.database.WrappedDatabase in project neo4j by neo4j.
the class RestfulGraphDatabasePagedTraversalTest method startDatabase.
@Before
public void startDatabase() throws IOException {
graph = (GraphDatabaseFacade) new TestGraphDatabaseFactory().newImpermanentDatabase();
database = new WrappedDatabase(graph);
helper = new GraphDbHelper(database);
output = new EntityOutputFormat(new JsonFormat(), URI.create(BASE_URI), null);
leaseManager = new LeaseManager(Clocks.fakeClock());
service = new RestfulGraphDatabase(new JsonFormat(), output, new DatabaseActions(leaseManager, true, database.getGraph()), null);
service = new TransactionWrappingRestfulGraphDatabase(graph, service);
}
Aggregations