mirror of
https://github.com/vcscsvcscs/GenerationsHeritage.git
synced 2025-08-14 14:59:07 +02:00
init integration test
This commit is contained in:
@@ -8,13 +8,13 @@ import (
|
||||
)
|
||||
|
||||
func (srv *server) DeleteRecipeRelationship( //nolint:revive // not implemented
|
||||
c *gin.Context, recipeId int, params api.DeleteRecipeRelationshipParams, //nolint:revive // not implemented
|
||||
c *gin.Context, id int, params api.DeleteRecipeRelationshipParams, //nolint:revive // not implemented
|
||||
) {
|
||||
c.JSON(http.StatusServiceUnavailable, gin.H{"msg": "not implemented"})
|
||||
}
|
||||
|
||||
func (srv *server) CreateRecipeRelationship( //nolint:revive // not implemented
|
||||
c *gin.Context, recipeId int, params api.CreateRecipeRelationshipParams, //nolint:revive // not implemented
|
||||
c *gin.Context, id int, params api.CreateRecipeRelationshipParams, //nolint:revive // not implemented
|
||||
) {
|
||||
c.JSON(http.StatusServiceUnavailable, gin.H{"msg": "not implemented"})
|
||||
}
|
||||
|
@@ -2,22 +2,25 @@ package memgraph
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"github.com/neo4j/neo4j-go-driver/v5/neo4j"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func InitDatabase(dbURI, dbUser, dbPassword string) neo4j.DriverWithContext {
|
||||
func InitDatabase(logger *zap.Logger, dbURI, dbUser, dbPassword string) neo4j.DriverWithContext {
|
||||
driver, err := neo4j.NewDriverWithContext(dbURI, neo4j.BasicAuth(dbUser, dbPassword, ""))
|
||||
if err != nil {
|
||||
log.Panicln(err)
|
||||
logger.Panic("Unable to init driver due to:", zap.Error(err))
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
err = driver.VerifyConnectivity(ctx)
|
||||
if err != nil {
|
||||
log.Panicln(err)
|
||||
logger.Panic("Unable to connect to db:", zap.Error(err),
|
||||
zap.String("dbUser", dbUser),
|
||||
zap.String("dbURI", dbURI),
|
||||
)
|
||||
}
|
||||
|
||||
return driver
|
||||
|
Reference in New Issue
Block a user