Skip to content

Commit

Permalink
#deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaslacerdacl committed Mar 27, 2024
1 parent 1da5ab4 commit e3f50ad
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/application/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
func Api(ginApp *gin.Engine, db *gorm.DB) {
jsonPresenter := &presenters.JsonPresenter{}

healthCheckController.Handler(ginApp, db, jsonPresenter)
healthCheckController.Handler(ginApp, jsonPresenter)
helloWorldController.Handler(ginApp, db, jsonPresenter)

fmt.Println("API OK!")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"go-api-store-boilerplate/src/application/api/presenters"

"github.com/gin-gonic/gin"
"gorm.io/gorm"
)

type HealthCheckController struct {
Expand All @@ -30,7 +29,6 @@ func (hc HealthCheckController) PostWebHook(ctx *gin.Context) {

func Handler(
ginApp *gin.Engine,
db *gorm.DB,
jsonPresenter *presenters.JsonPresenter,
) {
healthCheckController := HealthCheckController{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package database
package tests

import (
"gorm.io/gorm"
)

func CleanUp(db *gorm.DB) {
func Run(db *gorm.DB) {
db.Exec("DELETE FROM hello_world_entities")
}
5 changes: 3 additions & 2 deletions tests/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tests
import (
ConfigContexts "go-api-store-boilerplate/src/application/config/models/contexts"
"go-api-store-boilerplate/src/infrastructure/database"
dbCleanUp "go-api-store-boilerplate/tests/db"
"os"
"testing"

Expand All @@ -29,9 +30,9 @@ func setup() {

db = database.Connect(localConfig)

database.CleanUp(db)
dbCleanUp.Run(db)
}

func teardown() {
database.CleanUp(db)
dbCleanUp.Run(db)
}

0 comments on commit e3f50ad

Please sign in to comment.