Search in sources :

Example 6 with Configuration

use of org.neo4j.ogm.config.Configuration in project spring-boot by spring-projects.

the class Neo4jPropertiesTests method credentialsAreSetFromUri.

@Test
public void credentialsAreSetFromUri() {
    Neo4jProperties properties = load(true, "spring.data.neo4j.uri=http://user:secret@my-server:7474");
    Configuration configuration = properties.createConfiguration();
    assertDriver(configuration, Neo4jProperties.HTTP_DRIVER, "http://user:secret@my-server:7474");
    assertCredentials(configuration, "user", "secret");
}
Also used : DriverConfiguration(org.neo4j.ogm.config.DriverConfiguration) Configuration(org.neo4j.ogm.config.Configuration) Test(org.junit.Test)

Example 7 with Configuration

use of org.neo4j.ogm.config.Configuration in project spring-boot by spring-projects.

the class Neo4jPropertiesTests method httpUriUseHttpServer.

@Test
public void httpUriUseHttpServer() {
    Neo4jProperties properties = load(true, "spring.data.neo4j.uri=http://localhost:7474");
    Configuration configuration = properties.createConfiguration();
    assertDriver(configuration, Neo4jProperties.HTTP_DRIVER, "http://localhost:7474");
}
Also used : DriverConfiguration(org.neo4j.ogm.config.DriverConfiguration) Configuration(org.neo4j.ogm.config.Configuration) Test(org.junit.Test)

Example 8 with Configuration

use of org.neo4j.ogm.config.Configuration in project spring-boot by spring-projects.

the class Neo4jPropertiesTests method defaultUseEmbeddedInMemoryIfAvailable.

@Test
public void defaultUseEmbeddedInMemoryIfAvailable() {
    Neo4jProperties properties = load(true);
    Configuration configuration = properties.createConfiguration();
    assertDriver(configuration, Neo4jProperties.EMBEDDED_DRIVER, null);
}
Also used : DriverConfiguration(org.neo4j.ogm.config.DriverConfiguration) Configuration(org.neo4j.ogm.config.Configuration) Test(org.junit.Test)

Example 9 with Configuration

use of org.neo4j.ogm.config.Configuration in project spring-boot by spring-projects.

the class Neo4jPropertiesTests method boltUriUseBoltDriver.

@Test
public void boltUriUseBoltDriver() {
    Neo4jProperties properties = load(true, "spring.data.neo4j.uri=bolt://localhost:7687");
    Configuration configuration = properties.createConfiguration();
    assertDriver(configuration, Neo4jProperties.BOLT_DRIVER, "bolt://localhost:7687");
}
Also used : DriverConfiguration(org.neo4j.ogm.config.DriverConfiguration) Configuration(org.neo4j.ogm.config.Configuration) Test(org.junit.Test)

Example 10 with Configuration

use of org.neo4j.ogm.config.Configuration in project spring-boot by spring-projects.

the class Neo4jPropertiesTests method credentialsAreSet.

@Test
public void credentialsAreSet() {
    Neo4jProperties properties = load(true, "spring.data.neo4j.uri=http://localhost:7474", "spring.data.neo4j.username=user", "spring.data.neo4j.password=secret");
    Configuration configuration = properties.createConfiguration();
    assertDriver(configuration, Neo4jProperties.HTTP_DRIVER, "http://localhost:7474");
    assertCredentials(configuration, "user", "secret");
}
Also used : DriverConfiguration(org.neo4j.ogm.config.DriverConfiguration) Configuration(org.neo4j.ogm.config.Configuration) Test(org.junit.Test)

Aggregations

Configuration (org.neo4j.ogm.config.Configuration)11 Test (org.junit.Test)10 DriverConfiguration (org.neo4j.ogm.config.DriverConfiguration)10 Car (com.baeldung.spring.data.neo4j.domain.Car)1 Company (com.baeldung.spring.data.neo4j.domain.Company)1 HashMap (java.util.HashMap)1 Result (org.neo4j.ogm.model.Result)1 Session (org.neo4j.ogm.session.Session)1 SessionFactory (org.neo4j.ogm.session.SessionFactory)1