diff --git a/pipelines/executable_step_test.go b/pipelines/executable_step_test.go index 0a4bb31..7719951 100644 --- a/pipelines/executable_step_test.go +++ b/pipelines/executable_step_test.go @@ -26,7 +26,7 @@ func TestDeserializeOptionsResizeImage(t *testing.T) { t.Run("Image pipeline deserialization is successful", func(t *testing.T) { values := DeserializePipelines([][]byte{[]byte(Payload)}) - _, err := values[0].GetSteps()[0].Translate() + _, err := values[0].GetSteps()[0].GetExecutable() assert.Equal(t, nil, err) }) @@ -51,7 +51,7 @@ func TestDeserializeOptionsCompressImage(t *testing.T) { t.Run("Image pipeline deserialization is successful", func(t *testing.T) { values := DeserializePipelines([][]byte{[]byte(Payload)}) - _, err := values[0].GetSteps()[0].Translate() + _, err := values[0].GetSteps()[0].GetExecutable() assert.Equal(t, nil, err) }) @@ -73,7 +73,7 @@ func TestDeserializeMissingOptions(t *testing.T) { t.Run("Image pipeline deserialization is successful", func(t *testing.T) { values := DeserializePipelines([][]byte{[]byte(Payload)}) - _, err := values[0].GetSteps()[0].Translate() + _, err := values[0].GetSteps()[0].GetExecutable() assert.EqualError(t, err, "unexpected end of JSON input") }) diff --git a/pipelines/step.go b/pipelines/step.go index eaed75c..aa80da3 100644 --- a/pipelines/step.go +++ b/pipelines/step.go @@ -18,7 +18,7 @@ type Step struct { Options json.RawMessage `json:"options"` } -func (s Step) Translate() (IExecutableStep, error) { +func (s Step) GetExecutable() (IExecutableStep, error) { switch s.GetType() { case TypeResizeImageStep: step := ResizeImageStep{} diff --git a/pipelines/step_test.go b/pipelines/step_test.go index d1c1c4e..f731f5f 100644 --- a/pipelines/step_test.go +++ b/pipelines/step_test.go @@ -28,7 +28,7 @@ func TestTranslateStep(t *testing.T) { assert.Equal(t, "resize image", steps[0].GetName()) assert.Equal(t, TypeResizeImageStep, steps[0].GetType()) - translated, err := steps[0].Translate() + translated, err := steps[0].GetExecutable() assert.Equal(t, nil, err) assert.IsType(t, ResizeImageStep{}, translated) }) @@ -57,7 +57,7 @@ func TestInvalidStepType(t *testing.T) { assert.Equal(t, "resize image", steps[0].GetName()) assert.Equal(t, StepType(99999), steps[0].GetType()) - translated, err := steps[0].Translate() + translated, err := steps[0].GetExecutable() assert.EqualError(t, err, "invalid type") assert.Nil(t, translated) })