Skip to content

Commit

Permalink
added test for ApplicationTypeList() and request with tenant
Browse files Browse the repository at this point in the history
usually it is not needed to use tenant to get list of all application types
  • Loading branch information
petracihalova committed Jul 26, 2022
1 parent b2c0a9f commit c9d8365
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions application_type_handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,32 @@ func TestApplicationTypeList(t *testing.T) {
testutils.AssertLinks(t, c.Request().RequestURI, out.Links, 100, 0)
}

// TestApplicationTypeListWithTenant tests that list of application types is returned
// even when tenant is provided (this request doesn't need a tenant)
func TestApplicationTypeListWithTenant(t *testing.T) {
tenantId := int64(1)
c, rec := request.CreateTestContext(
http.MethodGet,
"/api/sources/v3.1/application_types",
nil,
map[string]interface{}{
"limit": 100,
"offset": 0,
"filters": []util.Filter{},
"tenant": tenantId,
},
)

err := ApplicationTypeList(c)
if err != nil {
t.Error(err)
}

if rec.Code != 200 {
t.Error("Did not return 200")
}
}

func TestApplicationTypeListBadRequestInvalidFilter(t *testing.T) {
testutils.SkipIfNotRunningIntegrationTests(t)

Expand Down

0 comments on commit c9d8365

Please sign in to comment.