Documentation
¶
Index ¶
- func IsNeo4jAvailable() bool
- type Neo4jTestContainer
- func (tc *Neo4jTestContainer) ClearDatabase(ctx context.Context) error
- func (tc *Neo4jTestContainer) ClearDatabaseForProject(ctx context.Context, projectID string) error
- func (tc *Neo4jTestContainer) CreateDriver() (neo4j.DriverWithContext, error)
- func (tc *Neo4jTestContainer) CreateRepository() (*infra.Neo4jRepository, error)
- func (tc *Neo4jTestContainer) ExecuteCypher(ctx context.Context, query string, params map[string]any) error
- func (tc *Neo4jTestContainer) Stop(_ context.Context) error
- func (tc *Neo4jTestContainer) VerifyConnection(ctx context.Context) error
- type TestConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNeo4jAvailable ¶
func IsNeo4jAvailable() bool
IsNeo4jAvailable checks if Neo4j is available for testing
Types ¶
type Neo4jTestContainer ¶
Neo4jTestContainer holds the connection details for docker-compose Neo4j
func SetupNeo4jTest ¶
func SetupNeo4jTest(t *testing.T) (*Neo4jTestContainer, func())
SetupNeo4jTest is a convenience function for setting up Neo4j in tests It ensures Neo4j is running and returns a cleanup function
func StartNeo4jContainer ¶
func StartNeo4jContainer(ctx context.Context) (*Neo4jTestContainer, error)
StartNeo4jContainer ensures Neo4j is running via docker-compose or uses existing service in CI
func (*Neo4jTestContainer) ClearDatabase ¶
func (tc *Neo4jTestContainer) ClearDatabase(ctx context.Context) error
ClearDatabase removes all nodes and relationships from the database
func (*Neo4jTestContainer) ClearDatabaseForProject ¶
func (tc *Neo4jTestContainer) ClearDatabaseForProject(ctx context.Context, projectID string) error
ClearDatabaseForProject removes all nodes and relationships for a specific project
func (*Neo4jTestContainer) CreateDriver ¶
func (tc *Neo4jTestContainer) CreateDriver() (neo4j.DriverWithContext, error)
CreateDriver creates a new Neo4j driver for the test container
func (*Neo4jTestContainer) CreateRepository ¶
func (tc *Neo4jTestContainer) CreateRepository() (*infra.Neo4jRepository, error)
CreateRepository creates a new Neo4j repository using the test container
func (*Neo4jTestContainer) ExecuteCypher ¶
func (tc *Neo4jTestContainer) ExecuteCypher(ctx context.Context, query string, params map[string]any) error
ExecuteCypher executes a Cypher query against the test database
func (*Neo4jTestContainer) Stop ¶
func (tc *Neo4jTestContainer) Stop(_ context.Context) error
Stop is a no-op since docker-compose keeps running between tests
func (*Neo4jTestContainer) VerifyConnection ¶
func (tc *Neo4jTestContainer) VerifyConnection(ctx context.Context) error
VerifyConnection checks if the Neo4j connection is working
type TestConfig ¶
type TestConfig struct {
Neo4j struct {
URI string
Username string
Password string
Database string
}
}
TestConfig represents test configuration
func GetTestConfig ¶
func GetTestConfig() *TestConfig
GetTestConfig returns a default test configuration