This commit is contained in:
adlerhurst
2025-07-17 09:08:33 +02:00
parent 821b293025
commit 15d07c076f
4 changed files with 60 additions and 59 deletions

View File

@@ -54,7 +54,7 @@ func TestCreateInstance(t *testing.T) {
}
return instance
}(),
err: new(database.CheckErr),
err: new(database.CheckError),
},
{
name: "adding same instance twice",
@@ -79,7 +79,7 @@ func TestCreateInstance(t *testing.T) {
require.NoError(t, err)
return &inst
},
err: new(database.UniqueErr),
err: new(database.UniqueError),
},
func() struct {
name string
@@ -145,7 +145,7 @@ func TestCreateInstance(t *testing.T) {
}
return instance
}(),
err: new(database.CheckErr),
err: new(database.CheckError),
},
}
for _, tt := range tests {
@@ -262,7 +262,7 @@ func TestUpdateInstance(t *testing.T) {
return &inst
},
rowsAffected: 0,
getErr: new(database.ErrNoRowFound),
getErr: new(database.NoRowFoundError),
},
}
for _, tt := range tests {
@@ -341,7 +341,7 @@ func TestGetInstance(t *testing.T) {
}
return &inst
},
err: new(database.ErrNoRowFound),
err: new(database.NoRowFoundError),
},
}
for _, tt := range tests {
@@ -654,7 +654,7 @@ func TestDeleteInstance(t *testing.T) {
instance, err := instanceRepo.Get(ctx,
tt.instanceID,
)
require.ErrorIs(t, err, new(database.ErrNoRowFound))
require.ErrorIs(t, err, new(database.NoRowFoundError))
assert.Nil(t, instance)
})
}

View File

@@ -63,7 +63,7 @@ func TestCreateOrganization(t *testing.T) {
}
return organization
}(),
err: new(database.CheckErr),
err: new(database.CheckError),
},
{
name: "adding org with same id twice",
@@ -85,7 +85,7 @@ func TestCreateOrganization(t *testing.T) {
org.Name = gofakeit.Name()
return &org
},
err: new(database.UniqueErr),
err: new(database.UniqueError),
},
{
name: "adding org with same name twice",
@@ -107,7 +107,7 @@ func TestCreateOrganization(t *testing.T) {
org.ID = gofakeit.Name()
return &org
},
err: new(database.UniqueErr),
err: new(database.UniqueError),
},
func() struct {
name string
@@ -180,7 +180,7 @@ func TestCreateOrganization(t *testing.T) {
}
return organization
}(),
err: new(database.CheckErr),
err: new(database.CheckError),
},
{
name: "adding organization with no instance id",
@@ -194,7 +194,7 @@ func TestCreateOrganization(t *testing.T) {
}
return organization
}(),
err: new(database.ForeignKeyErr),
err: new(database.ForeignKeyError),
},
{
name: "adding organization with non existent instance id",
@@ -209,7 +209,7 @@ func TestCreateOrganization(t *testing.T) {
}
return organization
}(),
err: new(database.ForeignKeyErr),
err: new(database.ForeignKeyError),
},
}
for _, tt := range tests {
@@ -496,7 +496,7 @@ func TestGetOrganization(t *testing.T) {
return &org
},
orgIdentifierCondition: orgRepo.NameCondition("non-existent-instance-name"),
err: new(database.ErrNoRowFound),
err: new(database.NoRowFoundError),
},
}
for _, tt := range tests {
@@ -932,7 +932,7 @@ func TestDeleteOrganization(t *testing.T) {
tt.orgIdentifierCondition,
instanceId,
)
require.ErrorIs(t, err, new(database.ErrNoRowFound))
require.ErrorIs(t, err, new(database.NoRowFoundError))
assert.Nil(t, organization)
})
}