Skip to content

Commit 5235ab1

Browse files
author
Phil Brocker
committed
fix failing tests
1 parent c769520 commit 5235ab1

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

internal/provider/config/const.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ const (
6060
TestFirewallFirewallRangeAllTraffic = "0.0.0.0/0"
6161
// TestInitialWorkspaceID is the workspace ID in the example.
6262
TestInitialWorkspaceID = "26171125-ecb8-5944-9896-209fbffc1f15"
63+
// TestInitialUpdateWindowDay is the default update window day in examples.
64+
TestInitialUpdateWindowDay = 6
65+
// TestInitialUpdateWindowHour is the default update window hour in examples.
66+
TestInitialUpdateWindowHour = 14
6367
// TestWorkspaceName is the default workspace name in examples.
6468
TestWorkspaceName = "workspace"
6569
// TestInitialWorkspaceSize is the default workspace size in examples.

internal/provider/workspacegroups/resource.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ func toWorkspaceGroupResourceModel(workspaceGroup management.WorkspaceGroup, adm
336336
ExpiresAt: util.MaybeStringValue(workspaceGroup.ExpiresAt),
337337
RegionID: util.UUIDStringValue(workspaceGroup.RegionID),
338338
AdminPassword: types.StringValue(adminPassword),
339-
UpdateWindow: toupdateWindowResourceModel(workspaceGroup.UpdateWindow),
339+
UpdateWindow: toUpdateWindowResourceModel(workspaceGroup.UpdateWindow),
340340
}
341341
}
342342

@@ -405,7 +405,7 @@ func toManagementUpdateWindow(uw *updateWindowResourceModel) *management.UpdateW
405405
}
406406
}
407407

408-
func toupdateWindowResourceModel(uw *management.UpdateWindow) *updateWindowResourceModel {
408+
func toUpdateWindowResourceModel(uw *management.UpdateWindow) *updateWindowResourceModel {
409409
if uw == nil {
410410
return nil
411411
}

internal/provider/workspacegroups/resource_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestCRUDWorkspaceGroup(t *testing.T) {
4545
RegionID: regions[0].RegionID,
4646
State: management.PENDING, // During the first poll, the status will still be PENDING.
4747
TerminatedAt: nil,
48-
UpdateWindow: nil,
48+
UpdateWindow: &management.UpdateWindow{Day: config.TestInitialUpdateWindowDay, Hour: config.TestInitialUpdateWindowHour},
4949
WorkspaceGroupID: workspaceGroupID,
5050
}
5151

@@ -100,6 +100,8 @@ func TestCRUDWorkspaceGroup(t *testing.T) {
100100
require.Equal(t, []string{config.TestInitialFirewallRange}, input.FirewallRanges)
101101
require.Equal(t, config.TestInitialWorkspaceGroupName, input.Name)
102102
require.Equal(t, regions[0].RegionID, input.RegionID)
103+
require.Equal(t, config.TestInitialUpdateWindowDay, int(input.UpdateWindow.Day))
104+
require.Equal(t, config.TestInitialUpdateWindowHour, int(input.UpdateWindow.Hour))
103105

104106
w.Header().Add("Content-Type", "json")
105107
_, err = w.Write(testutil.MustJSON(

0 commit comments

Comments
 (0)