com.graphaware.test.integration.GraphAwareApiTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tests Show documentation
Show all versions of tests Show documentation
Tools for testing Neo4j-related and GraphAware-related code
/*
* Copyright (c) 2014 GraphAware
*
* This file is part of GraphAware.
*
* GraphAware is free software: you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of
* the GNU General Public License along with this program. If not, see
* .
*/
package com.graphaware.test.integration;
import com.graphaware.server.GraphAwareWrappingNeoServerBootstrapper;
import org.neo4j.kernel.GraphDatabaseAPI;
import org.neo4j.server.WrappingNeoServerBootstrapper;
import org.neo4j.server.configuration.ServerConfigurator;
/**
* Base-class for tests of APIs that are written as Spring MVC {@link org.springframework.stereotype.Controller}s
* and deployed using the GraphAware Framework.
*
* Starts a Neo4j server on the port specified using {@link #neoServerPort()} (or 7575 by default) and deploys all
* {@link org.springframework.stereotype.Controller} annotated controllers.
*
* Allows implementing tests to call {@link #getDatabase()} and thus gain low-level access to the database
* even when running within a server. This is useful, for instance, when using
* {@link com.graphaware.test.unit.GraphUnit} to assert the database state. Before tests are run, the database can be populated
* by overriding the {@link #populateDatabase(org.neo4j.graphdb.GraphDatabaseService)} method, or by providing a
* {@link com.graphaware.test.data.DatabasePopulator} in {@link #databasePopulator()}.
*/
public abstract class GraphAwareApiTest extends WrappingServerIntegrationTest {
@Override
protected WrappingNeoServerBootstrapper createBootstrapper(ServerConfigurator configurator) {
return new GraphAwareWrappingNeoServerBootstrapper((GraphDatabaseAPI) getDatabase(), configurator);
}
public String baseUrl() {
return baseNeoUrl() + "/graphaware";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy