diff --git a/builder/hcloud/step_create_server_test.go b/builder/hcloud/step_create_server_test.go index 85b273a6..6f1526e4 100644 --- a/builder/hcloud/step_create_server_test.go +++ b/builder/hcloud/step_create_server_test.go @@ -41,7 +41,7 @@ func TestStepCreateServer(t *testing.T) { Want: func(t *testing.T, req *http.Request) { payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{}) assert.Equal(t, "dummy-server", payload.Name) - assert.Equal(t, int64(114690387), int64(payload.Image.(float64))) + assert.Equal(t, int64(114690387), payload.Image.ID) assert.Equal(t, "nbg1", payload.Location) assert.Equal(t, "cpx11", payload.ServerType) assert.True(t, payload.PublicNet.EnableIPv4) @@ -119,7 +119,7 @@ func TestStepCreateServer(t *testing.T) { Want: func(t *testing.T, req *http.Request) { payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{}) assert.Equal(t, "dummy-server", payload.Name) - assert.Equal(t, int64(114690387), int64(payload.Image.(float64))) + assert.Equal(t, int64(114690387), payload.Image.ID) assert.Equal(t, "nbg1", payload.Location) assert.Equal(t, "cpx11", payload.ServerType) assert.Equal(t, int64(986532), payload.Firewalls[0].Firewall) @@ -189,7 +189,7 @@ func TestStepCreateServer(t *testing.T) { Want: func(t *testing.T, req *http.Request) { payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{}) assert.Equal(t, "dummy-server", payload.Name) - assert.Equal(t, int64(114690387), int64(payload.Image.(float64))) + assert.Equal(t, int64(114690387), payload.Image.ID) assert.Equal(t, "nbg1", payload.Location) assert.Equal(t, "cpx11", payload.ServerType) assert.Equal(t, []int64{12}, payload.Networks) @@ -287,7 +287,7 @@ func TestStepCreateServer(t *testing.T) { Want: func(t *testing.T, req *http.Request) { payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{}) assert.Equal(t, "dummy-server", payload.Name) - assert.Equal(t, int64(114690387), int64(payload.Image.(float64))) + assert.Equal(t, int64(114690387), payload.Image.ID) assert.Equal(t, "nbg1", payload.Location) assert.Equal(t, "cpx11", payload.ServerType) assert.Nil(t, payload.Networks) @@ -393,7 +393,7 @@ func TestStepCreateServer(t *testing.T) { Want: func(t *testing.T, req *http.Request) { payload := decodeJSONBody(t, req.Body, &schema.ServerCreateRequest{}) assert.Equal(t, "dummy-server", payload.Name) - assert.Equal(t, int64(114690387), int64(payload.Image.(float64))) + assert.Equal(t, int64(114690387), payload.Image.ID) assert.Equal(t, "nbg1", payload.Location) assert.Equal(t, "cpx11", payload.ServerType) assert.Nil(t, payload.Networks)