Commit 11a0c53b authored by Sonja Happ's avatar Sonja Happ
Browse files

rename simulator to infrastructure component

parent 9539c42e
......@@ -115,10 +115,10 @@ test:widget:
variables:
TEST_FOLDER: routes/widget
test:simulator:
test:infrastructure-component:
extends: test:database
variables:
TEST_FOLDER: routes/simulator
TEST_FOLDER: routes/infrastructure-component
test:file:
extends: test:database
......
......@@ -24,32 +24,32 @@ package amqp
import (
"git.rwth-aachen.de/acs/public/villas/web-backend-go/database"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/helper"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/simulator"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component"
"github.com/gin-gonic/gin"
"net/http"
"time"
)
func RegisterAMQPEndpoint(r *gin.RouterGroup) {
r.POST("/:simulatorID/action", sendActionToSimulator)
r.POST("/ICID/action", sendActionToIC)
}
// sendActionToSimulator godoc
// @Summary Send an action to simulator (only available if backend server is started with -amqp parameter)
// @ID sendActionToSimulator
// sendActionToIC godoc
// @Summary Send an action to IC (only available if backend server is started with -amqp parameter)
// @ID sendActionToIC
// @Tags AMQP
// @Produce json
// @Param inputAction query string true "Action for simulator"
// @Param inputAction query string true "Action for IC"
// @Success 200 {object} docs.ResponseError "Action sent successfully"
// @Failure 400 {object} docs.ResponseError "Bad request"
// @Failure 404 {object} docs.ResponseError "Not found"
// @Failure 422 {object} docs.ResponseError "Unprocessable entity"
// @Failure 500 {object} docs.ResponseError "Internal server error"
// @Param simulatorID path int true "Simulator ID"
// @Router /simulators/{simulatorID}/action [post]
func sendActionToSimulator(c *gin.Context) {
// @Param ICID path int true "InfrastructureComponent ID"
// @Router /ic/{ICID}/action [post]
func sendActionToIC(c *gin.Context) {
ok, s := simulator.CheckPermissions(c, database.ModelSimulatorAction, database.Update, true)
ok, s := infrastructure_component.CheckPermissions(c, database.ModelInfrastructureComponentAction, database.Update, true)
if !ok {
return
}
......@@ -70,7 +70,7 @@ func sendActionToSimulator(c *gin.Context) {
err = SendActionAMQP(action, s.UUID)
if err != nil {
helper.InternalServerError(c, "Unable to send actions to simulator: "+err.Error())
helper.InternalServerError(c, "Unable to send actions to IC: "+err.Error())
return
}
}
......
......@@ -77,8 +77,8 @@ func ConnectAMQP(uri string) error {
return fmt.Errorf("AMQP: failed to declare the exchange")
}
// add a queue for the simulators
simulatorQueue, err := client.channel.QueueDeclare("simulators",
// add a queue for the ICs
ICQueue, err := client.channel.QueueDeclare("infrastructure_components",
true,
false,
false,
......@@ -88,13 +88,13 @@ func ConnectAMQP(uri string) error {
return fmt.Errorf("AMQP: failed to declare the queue")
}
err = client.channel.QueueBind(simulatorQueue.Name, "", VILLAS_EXCHANGE, false, nil)
err = client.channel.QueueBind(ICQueue.Name, "", VILLAS_EXCHANGE, false, nil)
if err != nil {
return fmt.Errorf("AMQP: failed to bind the queue")
}
// consume deliveries
client.replies, err = client.channel.Consume(simulatorQueue.Name,
client.replies, err = client.channel.Consume(ICQueue.Name,
"",
false,
false,
......@@ -120,15 +120,15 @@ func ConnectAMQP(uri string) error {
continue
}
var sToBeUpdated database.Simulator
var sToBeUpdated database.InfrastructureComponent
db := database.GetDB()
simulatorUUID := gjson.Get(content, "properties.uuid").String()
if simulatorUUID == "" {
log.Println("AMQP: Could not extract UUID of simulator from content of received message, SIMULATOR NOT UPDATED")
ICUUID := gjson.Get(content, "properties.uuid").String()
if ICUUID == "" {
log.Println("AMQP: Could not extract UUID of IC from content of received message, COMPONENT NOT UPDATED")
} else {
err = db.Where("UUID = ?", simulatorUUID).Find(sToBeUpdated).Error
err = db.Where("UUID = ?", ICUUID).Find(sToBeUpdated).Error
if err != nil {
log.Println("AMQP: Unable to find simulator with UUID: ", gjson.Get(content, "properties.uuid"), " DB error message: ", err)
log.Println("AMQP: Unable to find IC with UUID: ", gjson.Get(content, "properties.uuid"), " DB error message: ", err)
}
err = db.Model(&sToBeUpdated).Updates(map[string]interface{}{
......@@ -140,10 +140,10 @@ func ConnectAMQP(uri string) error {
"RawProperties": gjson.Get(content, "properties"),
}).Error
if err != nil {
log.Println("AMQP: Unable to update simulator in DB: ", err)
log.Println("AMQP: Unable to update IC in DB: ", err)
}
log.Println("AMQP: Updated simulator with UUID ", gjson.Get(content, "properties.uuid"))
log.Println("AMQP: Updated IC with UUID ", gjson.Get(content, "properties.uuid"))
}
}
}()
......@@ -182,7 +182,7 @@ func SendActionAMQP(action Action, uuid string) error {
}
func PingAMQP() error {
log.Println("AMQP: sending ping command to all simulators")
log.Println("AMQP: sending ping command to all ICs")
var a Action
a.Act = "ping"
......
......@@ -55,9 +55,9 @@ read_users () {
-X GET | jq '.' && printf '\n'
}
read_simulators () {
printf "> GET "$apiBase"/simulators\n"
curl "$apiBase"/simulators -s \
read_infrastructure_components () {
printf "> GET "$apiBase"/ic\n"
curl "$apiBase"/ic -s \
-H "Contet-Type: application/json" \
-H "Authorization: Bearer $(< auth.jwt)" \
-X GET | jq '.' && printf '\n'
......@@ -114,7 +114,7 @@ login "$admin"
#create_user "$userC"
#read_users
#read_user 1
#read_simulators
#read_infrastructure_components
create_user "$newUserW"
#read_users
read_user 4
......
......@@ -102,7 +102,7 @@ func GetDB() *gorm.DB {
// TODO: Remove that function from the codebase and substitute the body
// to the Dummy*() where it is called
func DropTables(db *gorm.DB) {
db.DropTableIfExists(&Simulator{})
db.DropTableIfExists(&InfrastructureComponent{})
db.DropTableIfExists(&Signal{})
db.DropTableIfExists(&SimulationModel{})
db.DropTableIfExists(&File{})
......@@ -116,7 +116,7 @@ func DropTables(db *gorm.DB) {
// AutoMigrate the models
func MigrateModels(db *gorm.DB) {
db.AutoMigrate(&Simulator{})
db.AutoMigrate(&InfrastructureComponent{})
db.AutoMigrate(&Signal{})
db.AutoMigrate(&SimulationModel{})
db.AutoMigrate(&File{})
......
......@@ -173,38 +173,38 @@ func TestScenarioAssociations(t *testing.T) {
}
}
func TestSimulatorAssociations(t *testing.T) {
func TestICAssociations(t *testing.T) {
DropTables(db)
MigrateModels(db)
// create copies of global test data
simulatorA := SimulatorA
simulatorB := SimulatorB
icA := ICA
icB := ICB
modelA := SimulationModelA
modelB := SimulationModelB
// add simulators to DB
assert.NoError(t, db.Create(&simulatorA).Error)
assert.NoError(t, db.Create(&simulatorB).Error)
// add ICs to DB
assert.NoError(t, db.Create(&icA).Error)
assert.NoError(t, db.Create(&icB).Error)
// add simulation models to DB
assert.NoError(t, db.Create(&modelA).Error)
assert.NoError(t, db.Create(&modelB).Error)
// add simulator has many simulation models association to DB
assert.NoError(t, db.Model(&simulatorA).Association("SimulationModels").Append(&modelA).Error)
assert.NoError(t, db.Model(&simulatorA).Association("SimulationModels").Append(&modelB).Error)
// add IC has many simulation models association to DB
assert.NoError(t, db.Model(&icA).Association("SimulationModels").Append(&modelA).Error)
assert.NoError(t, db.Model(&icA).Association("SimulationModels").Append(&modelB).Error)
var simulator1 Simulator
assert.NoError(t, db.Find(&simulator1, 1).Error, fmt.Sprintf("Find Simulator with ID=1"))
assert.EqualValues(t, "Host_A", simulator1.Host)
var ic1 InfrastructureComponent
assert.NoError(t, db.Find(&ic1, 1).Error, fmt.Sprintf("Find InfrastructureComponent with ID=1"))
assert.EqualValues(t, "Host_A", ic1.Host)
// Get simulation models of simulator1
// Get simulation models of ic1
var models []SimulationModel
assert.NoError(t, db.Model(&simulator1).Association("SimulationModels").Find(&models).Error)
assert.NoError(t, db.Model(&ic1).Association("SimulationModels").Find(&models).Error)
if len(models) != 2 {
assert.Fail(t, "Simulator Associations",
assert.Fail(t, "InfrastructureComponent Associations",
"Expected to have %v SimulationModels. Has %v.", 2, len(models))
}
}
......@@ -225,8 +225,8 @@ func TestSimulationModelAssociations(t *testing.T) {
fileB := FileB
fileC := FileC
fileD := FileD
simulatorA := SimulatorA
simulatorB := SimulatorB
icA := ICA
icB := ICB
// add simulation models to DB
assert.NoError(t, db.Create(&modelA).Error)
......@@ -244,9 +244,9 @@ func TestSimulationModelAssociations(t *testing.T) {
assert.NoError(t, db.Create(&fileC).Error)
assert.NoError(t, db.Create(&fileD).Error)
// add simulators to DB
assert.NoError(t, db.Create(&simulatorA).Error)
assert.NoError(t, db.Create(&simulatorB).Error)
// add ICs to DB
assert.NoError(t, db.Create(&icA).Error)
assert.NoError(t, db.Create(&icB).Error)
// add simulation model has many signals associations
assert.NoError(t, db.Model(&modelA).Association("InputMapping").Append(&inSignalA).Error)
......@@ -258,17 +258,17 @@ func TestSimulationModelAssociations(t *testing.T) {
assert.NoError(t, db.Model(&modelA).Association("Files").Append(&fileC).Error)
assert.NoError(t, db.Model(&modelA).Association("Files").Append(&fileD).Error)
// associate simulation models with simulators
assert.NoError(t, db.Model(&simulatorA).Association("SimulationModels").Append(&modelA).Error)
assert.NoError(t, db.Model(&simulatorA).Association("SimulationModels").Append(&modelB).Error)
// associate simulation models with IC
assert.NoError(t, db.Model(&icA).Association("SimulationModels").Append(&modelA).Error)
assert.NoError(t, db.Model(&icA).Association("SimulationModels").Append(&modelB).Error)
var model1 SimulationModel
assert.NoError(t, db.Find(&model1, 1).Error, fmt.Sprintf("Find SimulationModel with ID=1"))
assert.EqualValues(t, "SimulationModel_A", model1.Name)
// Check simulator ID
if model1.SimulatorID != 1 {
assert.Fail(t, "Simulation Model expected to have Simulator ID 1, but is %v", model1.SimulatorID)
// Check IC ID
if model1.ICID != 1 {
assert.Fail(t, "Simulation Model expected to have InfrastructureComponent ID 1, but is %v", model1.ICID)
}
// Get OutputMapping signals of model1
......
......@@ -84,8 +84,8 @@ type SimulationModel struct {
StartParameters postgres.Jsonb `json:"startParameters"`
// ID of Scenario to which simulation model belongs
ScenarioID uint `json:"scenarioID"`
// ID of simulator associated with simulation model
SimulatorID uint `json:"simulatorID"`
// ID of IC associated with simulation model
ICID uint `json:"icID"`
// Mapping of output signals of the simulation model, order of signals is important
OutputMapping []Signal `json:"-" gorm:"foreignkey:SimulationModelID"`
// Mapping of input signals of the simulation model, order of signals is important
......@@ -111,27 +111,27 @@ type Signal struct {
SimulationModelID uint `json:"simulationModelID"`
}
// Simulator data model
type Simulator struct {
// InfrastructureComponent data model
type InfrastructureComponent struct {
Model
// UUID of the simulator
// UUID of the IC
UUID string `json:"uuid" gorm:"not null"`
// Host if the simulator
// Host if the IC
Host string `json:"host" gorm:"default:''"`
// Model type supported by the simulator
// Model type supported by the IC
Modeltype string `json:"modelType" gorm:"default:''"`
// Uptime of the simulator
// Uptime of the IC
Uptime int `json:"uptime" gorm:"default:0"`
// State of the simulator
// State of the IC
State string `json:"state" gorm:"default:''"`
// Time of last state update
StateUpdateAt string `json:"stateUpdateAt" gorm:"default:''"`
// Properties of simulator as JSON string
// Properties of IC as JSON string
Properties postgres.Jsonb `json:"properties"`
// Raw properties of simulator as JSON string
// Raw properties of IC as JSON string
RawProperties postgres.Jsonb `json:"rawProperties"`
// SimulationModels in which the simulator is used
SimulationModels []SimulationModel `json:"-" gorm:"foreignkey:SimulatorID"`
// SimulationModels in which the IC is used
SimulationModels []SimulationModel `json:"-" gorm:"foreignkey:ICID"`
}
// Dashboard data model
......
......@@ -38,8 +38,8 @@ type ModelName string
const ModelUser = ModelName("user")
const ModelUsers = ModelName("users")
const ModelScenario = ModelName("scenario")
const ModelSimulator = ModelName("simulator")
const ModelSimulatorAction = ModelName("simulatoraction")
const ModelInfrastructureComponent = ModelName("ic")
const ModelInfrastructureComponentAction = ModelName("icaction")
const ModelDashboard = ModelName("dashboard")
const ModelWidget = ModelName("widget")
const ModelSimulationModel = ModelName("simulationmodel")
......@@ -73,40 +73,40 @@ var none = Permission{Create: false, Read: false, Update: false, Delete: false}
// allowed to do a certain action on a given model based on his role
var Roles = RoleActions{
"Admin": {
ModelUser: crud,
ModelUsers: crud,
ModelScenario: crud,
ModelSimulationModel: crud,
ModelSimulator: crud,
ModelSimulatorAction: crud,
ModelWidget: crud,
ModelDashboard: crud,
ModelSignal: crud,
ModelFile: crud,
ModelUser: crud,
ModelUsers: crud,
ModelScenario: crud,
ModelSimulationModel: crud,
ModelInfrastructureComponent: crud,
ModelInfrastructureComponentAction: crud,
ModelWidget: crud,
ModelDashboard: crud,
ModelSignal: crud,
ModelFile: crud,
},
"User": {
ModelUser: _ru_,
ModelUsers: none,
ModelScenario: crud,
ModelSimulationModel: crud,
ModelSimulator: _r__,
ModelSimulatorAction: _ru_,
ModelWidget: crud,
ModelDashboard: crud,
ModelSignal: crud,
ModelFile: crud,
ModelUser: _ru_,
ModelUsers: none,
ModelScenario: crud,
ModelSimulationModel: crud,
ModelInfrastructureComponent: _r__,
ModelInfrastructureComponentAction: _ru_,
ModelWidget: crud,
ModelDashboard: crud,
ModelSignal: crud,
ModelFile: crud,
},
"Guest": {
ModelScenario: _r__,
ModelSimulationModel: _r__,
ModelDashboard: _r__,
ModelWidget: _r__,
ModelSimulator: _r__,
ModelSimulatorAction: _r__,
ModelUser: _ru_,
ModelUsers: none,
ModelSignal: _r__,
ModelFile: _r__,
ModelScenario: _r__,
ModelSimulationModel: _r__,
ModelDashboard: _r__,
ModelWidget: _r__,
ModelInfrastructureComponent: _r__,
ModelInfrastructureComponentAction: _r__,
ModelUser: _ru_,
ModelUsers: none,
ModelSignal: _r__,
ModelFile: _r__,
},
}
......
......@@ -55,12 +55,12 @@ var UserB = User{Username: "User_B", Password: string(pwB),
var UserC = User{Username: "User_C", Password: string(pwC),
Role: "Guest", Mail: "User_C@example.com", Active: true}
// Simulators
// Infrastructure components
var propertiesA = json.RawMessage(`{"name" : "TestNameA", "category" : "CategoryA", "location" : "anywhere on earth", "type": "dummy"}`)
var propertiesB = json.RawMessage(`{"name" : "TestNameB", "category" : "CategoryB", "location" : "where ever you want", "type": "generic"}`)
var propertiesA = json.RawMessage(`{"name" : "DPsim simulator", "category" : "Simulator", "location" : "ACSlab", "type": "DPsim"}`)
var propertiesB = json.RawMessage(`{"name" : "VILLASnode gateway", "category" : "Gateway", "location" : "ACSlab", "type": "VILLASnode"}`)
var SimulatorA = Simulator{
var ICA = InfrastructureComponent{
UUID: "4854af30-325f-44a5-ad59-b67b2597de68",
Host: "Host_A",
Modeltype: "ModelTypeA",
......@@ -71,7 +71,7 @@ var SimulatorA = Simulator{
RawProperties: postgres.Jsonb{propertiesA},
}
var SimulatorB = Simulator{
var ICB = InfrastructureComponent{
UUID: "7be0322d-354e-431e-84bd-ae4c9633138b",
Host: "Host_B",
Modeltype: "ModelTypeB",
......@@ -316,8 +316,8 @@ func DBAddTestData(db *gorm.DB) error {
userB := UserB
userC := UserC
simulatorA := SimulatorA
simulatorB := SimulatorB
ICA := ICA
ICB := ICB
scenarioA := ScenarioA
scenarioB := ScenarioB
......@@ -354,9 +354,9 @@ func DBAddTestData(db *gorm.DB) error {
// add Guest user to DB
err = db.Create(&userC).Error
// Simulators
err = db.Create(&simulatorA).Error
err = db.Create(&simulatorB).Error
// ICs
err = db.Create(&ICA).Error
err = db.Create(&ICB).Error
// Scenarios
err = db.Create(&scenarioA).Error
......@@ -425,9 +425,9 @@ func DBAddTestData(db *gorm.DB) error {
err = db.Model(&modelA).Association("Files").Append(&fileC).Error
err = db.Model(&modelA).Association("Files").Append(&fileD).Error
// Simulator HM SimulationModels
err = db.Model(&simulatorA).Association("SimulationModels").Append(&modelA).Error
err = db.Model(&simulatorA).Association("SimulationModels").Append(&modelB).Error
// InfrastructureComponent HM SimulationModels
err = db.Model(&ICA).Association("SimulationModels").Append(&modelA).Error
err = db.Model(&ICA).Association("SimulationModels").Append(&modelB).Error
// Widget HM Files
err = db.Model(&widgetA).Association("Files").Append(&fileA).Error
......
This diff is collapsed.
......@@ -46,12 +46,12 @@ type ResponseUser struct {
user database.User
}
type ResponseSimulators struct {
simulators []database.Simulator
type ResponseICs struct {
ics []database.InfrastructureComponent
}
type ResponseSimulator struct {
simulator database.Simulator
type ResponseIC struct {
ic database.InfrastructureComponent
}
type ResponseScenarios struct {
......
This diff is collapsed.
This diff is collapsed.
......@@ -28,9 +28,9 @@ import (
"git.rwth-aachen.de/acs/public/villas/web-backend-go/database"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/helper"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/dashboard"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/infrastructure-component"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/scenario"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/simulationmodel"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/simulator"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/user"
"git.rwth-aachen.de/acs/public/villas/web-backend-go/routes/widget"
"github.com/gin-gonic/gin"
......@@ -52,11 +52,11 @@ var db *gorm.DB
type SimulationModelRequest struct {
Name string `json:"name,omitempty"`
ScenarioID uint `json:"scenarioID,omitempty"`
SimulatorID uint `json:"simulatorID,omitempty"`
ICID uint `json:"icID,omitempty"`
StartParameters postgres.Jsonb `json:"startParameters,omitempty"`
}
type SimulatorRequest struct {
type ICRequest struct {
UUID string `json:"uuid,omitempty"`
Host string `json:"host,omitempty"`
Modeltype string `json:"modelType,omitempty"`
......@@ -91,25 +91,25 @@ type WidgetRequest struct {
CustomProperties postgres.Jsonb `json:"customProperties,omitempty"`
}
func addScenarioAndSimulatorAndSimulationModelAndDashboardAndWidget() (scenarioID uint, simulatorID uint, simulationModelID uint, dashboardID uint, widgetID uint) {
func addScenarioAndICAndSimulationModelAndDashboardAndWidget() (scenarioID uint, ICID uint, simulationModelID uint, dashboardID uint, widgetID uint) {
// authenticate as admin
token, _ := helper.AuthenticateForTest(router,
"/api/authenticate", "POST", helper.AdminCredentials)
// POST $newSimulatorA
newSimulatorA := SimulatorRequest{
UUID: database.SimulatorA.UUID,
Host: database.SimulatorA.Host,
Modeltype: database.SimulatorA.Modeltype,
State: database.SimulatorA.State,
Properties: database.SimulatorA.Properties,
// POST $newICA
newICA := ICRequest{
UUID: database.ICA.UUID,
Host: database.ICA.Host,
Modeltype: database.ICA.Modeltype,
State: database.ICA.State,
Properties: database.ICA.Properties,
}
_, resp, _ := helper.TestEndpoint(router, token,
"/api/simulators", "POST", helper.KeyModels{"simulator": newSimulatorA})
"/api/ic", "POST", helper.KeyModels{"ic": newICA})
// Read newSimulator's ID from the response
newSimulatorID, _ := helper.GetResponseID(resp)
// Read newIC's ID from the response
newICID, _ := helper.GetResponseID(resp)
// authenticate as normal user
token, _ = helper.AuthenticateForTest(router,
......@@ -131,7 +131,7 @@ func addScenarioAndSimulatorAndSimulationModelAndDashboardAndWidget() (scenarioI
newSimulationModel := SimulationModelRequest{
Name: database.SimulationModelA.Name,
ScenarioID: uint(newScenarioID),
SimulatorID: uint(newSimulatorID),
ICID: uint(newICID),
StartParameters: database.SimulationModelA.StartParameters,
}
_, resp, _ = helper.TestEndpoint(router, token,
......@@ -177,7 +177,7 @@ func addScenarioAndSimulatorAndSimulationModelAndDashboardAndWidget() (scenarioI
_, resp, _ = helper.TestEndpoint(router, token,
fmt.Sprintf("/api/scenarios/%v/user?username=User_C", newScenarioID), "PUT", nil)
return uint(newScenarioID), uint(newSimulatorID), uint(newSimulationModelID), uint(newDashboardID), uint(newWidgetID)
return uint(newScenarioID), uint(newICID), uint(newSimulationModelID), uint(newDashboardID), uint(newWidgetID)
}
func TestMain(m *testing.M) {
......@@ -202,9 +202,9 @@ func TestMain(m *testing.M) {
// scenario endpoints required here to first add a scenario to the DB
// that can be associated with a new simulation model
scenario.RegisterScenarioEndpoints(api.Group("/scenarios"))
// simulator endpoints required here to first add a simulator to the DB
// IC endpoints required here to first add a IC to the DB
// that can be associated with a new simulation model
simulator.RegisterSimulatorEndpoints(api.Group("/simulators"))
infrastructure_component.RegisterICEndpoints(api.Group("/ic"))
// dashboard endpoints required here to first add a dashboard to the DB
// that can be associated with a new widget
dashboard.RegisterDashboardEndpoints(api.Group("/dashboards"))
......@@ -224,7 +224,7 @@ func TestAddFile(t *testing.T) {
// prepare the content of the DB for testing
// using the respective endpoints of the API
_, _, simulationModelID, _, widgetID := addScenarioAndSimulatorAndSimulationModelAndDashboardAndWidget()
_, _, simulationModelID, _, widgetID := addScenarioAndICAndSimulationModelAndDashboardAndWidget()
// authenticate as userB who has no access to the elements in the DB
token, err := helper.AuthenticateForTest(router,
......@@ -340,7 +340,7 @@ func TestUpdateFile(t *testing.T) {
// prepare the content of the DB for testing
// using the respective endpoints of the API
_, _, simulationModelID, _, _ := addScenarioAndSimulatorAndSimulationModelAndDashboardAndWidget()
_, _, simulationModelID, _, _ := addScenarioAndICAndSimulationModelAndDashboardAndWidget()
// authenticate as normal user
token, err := helper.AuthenticateForTest(router,
......@@ -474,7 +474,7 @@ func TestDeleteFile(t *testing.T) {