Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
1riatsila1 committed Oct 24, 2024
1 parent 8749cf0 commit e645b82
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions pkg/config-api-client/test/api_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {
parent_uid := "parent_uid"
gock.New(configuration.Scheme + "://" + configuration.Host).
Get("/uxi/v1alpha1/groups").
MatchParams(map[string]string{"id": "uid", "limit": "10", "cursor": "some-cursor"}).
MatchParams(map[string]string{"id": "uid", "limit": "10", "next": "some-cursor"}).
Reply(200).
JSON(map[string]interface{}{
"items": []map[string]interface{}{
Expand All @@ -43,7 +43,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {
GroupsGetUxiV1alpha1GroupsGet(context.Background()).
Id("uid").
Limit(10).
Cursor("some-cursor").
Next("some-cursor").
Execute()

resourceType := "uxi/group"
Expand Down Expand Up @@ -141,7 +141,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {
t.Run("Test ConfigurationAPIService GetUxiV1alpha1SensorsGet", func(t *testing.T) {
gock.New(configuration.Scheme + "://" + configuration.Host).
Get("/uxi/v1alpha1/sensors").
MatchParams(map[string]string{"id": "uid", "limit": "10", "cursor": "some-cursor"}).
MatchParams(map[string]string{"id": "uid", "limit": "10", "next": "some-cursor"}).
Reply(200).
JSON(map[string]interface{}{
"items": []map[string]interface{}{
Expand All @@ -168,7 +168,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {
GetUxiV1alpha1SensorsGet(context.Background()).
Id("uid").
Limit(10).
Cursor("some-cursor").
Next("some-cursor").
Execute()

resourceType := "uxi/sensor"
Expand Down Expand Up @@ -209,7 +209,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {

gock.New(configuration.Scheme + "://" + configuration.Host).
Get("/uxi/v1alpha1/sensor-group-assignments").
MatchParams(map[string]string{"id": "uid", "limit": "10", "cursor": "some-cursor"}).
MatchParams(map[string]string{"id": "uid", "limit": "10", "next": "some-cursor"}).
Reply(200).
JSON(map[string]interface{}{
"items": []map[string]interface{}{
Expand All @@ -227,7 +227,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {
GetUxiV1alpha1SensorGroupAssignmentsGet(context.Background()).
Id("uid").
Limit(10).
Cursor("some-cursor").
Next("some-cursor").
Execute()

require.Nil(t, err)
Expand Down Expand Up @@ -295,7 +295,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {

gock.New(configuration.Scheme + "://" + configuration.Host).
Get("/uxi/v1alpha1/wired-networks").
MatchParams(map[string]string{"id": "uid", "limit": "10", "cursor": "some-cursor"}).
MatchParams(map[string]string{"id": "uid", "limit": "10", "next": "some-cursor"}).
Reply(200).
JSON(map[string]interface{}{
"items": []map[string]interface{}{
Expand All @@ -321,7 +321,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {
GetUxiV1alpha1WiredNetworksGet(context.Background()).
Id("uid").
Limit(10).
Cursor("some-cursor").
Next("some-cursor").
Execute()

security := "security"
Expand Down Expand Up @@ -357,7 +357,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {

gock.New(configuration.Scheme + "://" + configuration.Host).
Get("/uxi/v1alpha1/wireless-networks").
MatchParams(map[string]string{"id": "uid", "limit": "10", "cursor": "some-cursor"}).
MatchParams(map[string]string{"id": "uid", "limit": "10", "next": "some-cursor"}).
Reply(200).
JSON(map[string]interface{}{
"items": []map[string]interface{}{
Expand Down Expand Up @@ -385,7 +385,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {
GetUxiV1alpha1WirelessNetworksGet(context.Background()).
Id("uid").
Limit(10).
Cursor("some-cursor").
Next("some-cursor").
Execute()

security := "security"
Expand Down Expand Up @@ -422,7 +422,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {

gock.New(configuration.Scheme + "://" + configuration.Host).
Get("/uxi/v1alpha1/network-group-assignments").
MatchParams(map[string]string{"id": "uid", "limit": "10", "cursor": "some-cursor"}).
MatchParams(map[string]string{"id": "uid", "limit": "10", "next": "some-cursor"}).
Reply(200).
JSON(map[string]interface{}{
"items": []map[string]interface{}{
Expand All @@ -440,7 +440,7 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {
GetUxiV1alpha1NetworkGroupAssignmentsGet(context.Background()).
Id("uid").
Limit(10).
Cursor("some-cursor").
Next("some-cursor").
Execute()

resourceType := "uxi/network-group-assignment"
Expand Down Expand Up @@ -537,4 +537,18 @@ func Test_config_api_client_ConfigurationAPIService(t *testing.T) {
Type: &resourceType,
})
})

t.Run("Test ConfigurationAPIService DeleteServiceTestGroupAssignmentUxiV1alpha1ServiceTestGroupAssignmentsIdDelete", func(t *testing.T) {

gock.New(configuration.Scheme + "://" + configuration.Host).
Delete("/uxi/v1alpha1/service-test-group-assignments/uid").
Reply(204)

_, httpRes, err := apiClient.ConfigurationAPI.
DeleteServiceTestGroupAssignmentUxiV1alpha1ServiceTestGroupAssignmentsIdDelete(context.Background(), "uid").
Execute()

require.Nil(t, err)
assert.Equal(t, 204, httpRes.StatusCode)
})
}

0 comments on commit e645b82

Please sign in to comment.