private Infrastructure createInfrastructure(Neo4jMappingContext mappingContext) throws Exception {
MappingInfrastructureFactoryBean factoryBean = new MappingInfrastructureFactoryBean();
final GraphDatabaseService gdb = new TestGraphDatabaseFactory().newImpermanentDatabase();
factoryBean.setGraphDatabaseService(gdb);
final DelegatingGraphDatabase graphDatabase = new DelegatingGraphDatabase(gdb);
factoryBean.setGraphDatabase(graphDatabase);
factoryBean.setMappingContext(mappingContext);
final EntityStateHandler entityStateHandler = new EntityStateHandler(mappingContext, graphDatabase, conversionService);
final NoopNodeTypeRepresentationStrategy nodeTypeRepresentationStrategy = new NoopNodeTypeRepresentationStrategy();
factoryBean.setNodeTypeRepresentationStrategy(nodeTypeRepresentationStrategy);