Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions syntheticsclientv2/common_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ type DowntimeConfiguration struct {
Testcount int `json:"testCount,omitempty"`
Testids []int `json:"testIds,omitempty"`
Recurrence *Recurrence `json:"recurrence"`
Timezone *string `json:"timezone,omitempty"`
}

type DeleteCheck struct {
Expand Down
6 changes: 5 additions & 1 deletion syntheticsclientv2/create_downtimeconfigurationv2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
)

var (
createDowntimeConfigurationV2Body = `{"downtimeConfiguration":{"name":"dc test","description":"My super awesome test downtimeConfiguration","rule":"augment_data","testIds":[482],"startTime":"2024-05-16T20:23:00.000Z","endTime":"2024-05-16T20:38:00.000Z","recurrence":{"repeats":{"type":"daily"},"end":{"type":"after","value":"10"}}}}`
createDowntimeConfigurationV2Body = `{"downtimeConfiguration":{"name":"dc test","description":"My super awesome test downtimeConfiguration","rule":"augment_data","testIds":[482],"startTime":"2024-05-16T20:23:00.000Z","endTime":"2024-05-16T20:38:00.000Z","timezone":"UTC","recurrence":{"repeats":{"type":"daily"},"end":{"type":"after","value":"10"}}}}`
inputDowntimeConfigurationV2Data = DowntimeConfigurationV2Input{}
)

Expand Down Expand Up @@ -83,4 +83,8 @@ func TestCreateDowntimeConfigurationV2(t *testing.T) {
t.Errorf("returned \n\n%#v want \n\n%#v", resp.DowntimeConfiguration.Recurrence, inputDowntimeConfigurationV2Data.DowntimeConfiguration.Recurrence)
}

if !reflect.DeepEqual(resp.DowntimeConfiguration.Timezone, inputDowntimeConfigurationV2Data.DowntimeConfiguration.Timezone) {
t.Errorf("returned \n\n%#v want \n\n%#v", resp.DowntimeConfiguration.Timezone, inputDowntimeConfigurationV2Data.DowntimeConfiguration.Timezone)
}

}
8 changes: 6 additions & 2 deletions syntheticsclientv2/get_downtimeconfigurationsv2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import (
var (
getDowntimeConfigurationsV2Body = `{"page":1,"perPage":50}`
inputGetDowntimeConfigurationsV2 = verifyDowntimeConfigurationsV2Input(string(getDowntimeConfigurationsV2Body))
getDowntimeConfigurationsV2Output = `{"downtimeConfigurations":[{"id":1,"name":"dc test","description":"My super awesome test downtimeConfiguration","rule":"pause_tests","startTime":"2024-05-16T20:23:00.000Z","endTime":"2024-05-16T20:38:00.000Z","status":"scheduled","createdAt":"2024-05-15T20:24:07.541Z","updatedAt":"2024-05-15T20:25:44.211Z","testsUpdatedAt":"2024-05-15T20:24:07.541Z","testCount":1,"recurrence":{"repeats":{"type":"daily"},"end":{"type":"after","value":"10"}}}],"page":1,"pageLimit":1,"totalCount":1}`
getDowntimeConfigurationsV2Output = `{"downtimeConfigurations":[{"id":1,"name":"dc test","description":"My super awesome test downtimeConfiguration","rule":"pause_tests","startTime":"2024-05-16T20:23:00.000Z","endTime":"2024-05-16T20:38:00.000Z","status":"scheduled","createdAt":"2024-05-15T20:24:07.541Z","updatedAt":"2024-05-15T20:25:44.211Z","testsUpdatedAt":"2024-05-15T20:24:07.541Z","testCount":1,"timezone":"UTC","recurrence":{"repeats":{"type":"daily"},"end":{"type":"after","value":"10"}}}],"page":1,"pageLimit":1,"totalCount":1}`
downtimeConfigurationsV2Output = &DowntimeConfigurationsV2Response{}
getDowntimeConfigurationV2Body = `{"downtimeConfiguration":{"id":1,"name":"dc test","description":"My super awesome test downtimeConfiguration","rule":"pause_tests","startTime":"2024-05-16T20:23:00.000Z","endTime":"2024-05-16T20:38:00.000Z","status":"scheduled","createdAt":"2024-05-15T20:24:07.541Z","updatedAt":"2024-05-15T20:25:44.211Z","testsUpdatedAt":"2024-05-15T20:24:07.541Z","testIds":[29976],"recurrence":{"repeats":{"type":"daily"},"end":{"type":"after","value":"10"}}}}`
getDowntimeConfigurationV2Body = `{"downtimeConfiguration":{"id":1,"name":"dc test","description":"My super awesome test downtimeConfiguration","rule":"pause_tests","startTime":"2024-05-16T20:23:00.000Z","endTime":"2024-05-16T20:38:00.000Z","status":"scheduled","createdAt":"2024-05-15T20:24:07.541Z","updatedAt":"2024-05-15T20:25:44.211Z","testsUpdatedAt":"2024-05-15T20:24:07.541Z","testIds":[29976],"timezone":"UTC","recurrence":{"repeats":{"type":"daily"},"end":{"type":"after","value":"10"}}}}`
inputGetDowntimeConfigurationV2 = verifyDowntimeConfigurationV2Input(string(getDowntimeConfigurationV2Body))
)

Expand Down Expand Up @@ -94,6 +94,10 @@ func TestGetDowntimeConfigurationV2(t *testing.T) {
t.Errorf("returned \n\n%#v want \n\n%#v", resp.DowntimeConfiguration.Recurrence, inputGetDowntimeConfigurationV2.DowntimeConfiguration.Recurrence)
}

if !reflect.DeepEqual(resp.DowntimeConfiguration.Timezone, inputGetDowntimeConfigurationV2.DowntimeConfiguration.Timezone) {
t.Errorf("returned \n\n%#v want \n\n%#v", resp.DowntimeConfiguration.Timezone, inputGetDowntimeConfigurationV2.DowntimeConfiguration.Timezone)
}

}

func verifyDowntimeConfigurationV2Input(stringInput string) *DowntimeConfigurationV2Response {
Expand Down