mirror of
https://github.com/pushbits/server.git
synced 2025-05-10 15:37:00 +02:00
fix staticcheck reported issues
This commit is contained in:
parent
647f8fa8c4
commit
8bdd7166b8
5 changed files with 17 additions and 17 deletions
|
@ -93,7 +93,7 @@ func TestApi_RegisterApplicationWithoutUser(t *testing.T) {
|
|||
reqWoUser := tests.Request{Name: "Invalid JSON Data", Method: "POST", Endpoint: "/application", Data: `{"name": "test1", "strict_compatibility": true}`, Headers: map[string]string{"Content-Type": "application/json"}}
|
||||
_, c, err := reqWoUser.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
assert.Panicsf(func() { TestApplicationHandler.CreateApplication(c) }, "CreateApplication did not panic although user is not in context")
|
||||
|
@ -115,7 +115,7 @@ func TestApi_RegisterApplication(t *testing.T) {
|
|||
var application model.Application
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("user", user)
|
||||
|
@ -150,7 +150,7 @@ func TestApi_GetApplications(t *testing.T) {
|
|||
for _, req := range testCases {
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("user", user)
|
||||
|
@ -183,7 +183,7 @@ func TestApi_GetApplicationsWithoutUser(t *testing.T) {
|
|||
|
||||
_, c, err := testCase.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
assert.Panicsf(func() { TestApplicationHandler.GetApplications(c) }, "GetApplications did not panic although user is not in context")
|
||||
|
@ -203,7 +203,7 @@ func TestApi_GetApplicationErrors(t *testing.T) {
|
|||
for id, req := range testCases {
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("user", user)
|
||||
|
@ -229,7 +229,7 @@ func TestApi_GetApplication(t *testing.T) {
|
|||
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("user", user)
|
||||
|
@ -282,7 +282,7 @@ func TestApi_UpdateApplication(t *testing.T) {
|
|||
for id, req := range testCases {
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("user", user)
|
||||
|
@ -310,7 +310,7 @@ func TestApi_DeleteApplication(t *testing.T) {
|
|||
for id, req := range testCases {
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("user", user)
|
||||
|
|
|
@ -32,7 +32,7 @@ func TestApi_getID(t *testing.T) {
|
|||
for id, req := range testCases {
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("id", id)
|
||||
|
@ -74,7 +74,7 @@ func TestApi_getApplication(t *testing.T) {
|
|||
for id, req := range testCases {
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("id", id)
|
||||
|
@ -109,7 +109,7 @@ func TestApi_getUser(t *testing.T) {
|
|||
for id, req := range testCases {
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("id", id)
|
||||
|
|
|
@ -19,7 +19,7 @@ func TestApi_Health(t *testing.T) {
|
|||
for _, req := range testCases {
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
handler.Health(c)
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ func TestApi_CreateNotification(t *testing.T) {
|
|||
var notification model.Notification
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("app", &testApplication)
|
||||
|
@ -83,7 +83,7 @@ func TestApi_DeleteNotification(t *testing.T) {
|
|||
for id, req := range testCases {
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("app", &testApplication)
|
||||
|
|
|
@ -45,7 +45,7 @@ func TestApi_CreateUser(t *testing.T) {
|
|||
for _, req := range testCases {
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
TestUserHandler.CreateUser(c)
|
||||
|
@ -120,7 +120,7 @@ func TestApi_UpdateUser(t *testing.T) {
|
|||
for id, req := range testCases {
|
||||
w, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("id", id)
|
||||
|
@ -134,7 +134,7 @@ func TestApi_UpdateUser(t *testing.T) {
|
|||
for id, req := range testCases {
|
||||
_, c, err := req.GetRequest()
|
||||
if err != nil {
|
||||
t.Fatalf(err.Error())
|
||||
t.Fatal(err.Error())
|
||||
}
|
||||
|
||||
c.Set("id", id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue