diff --git a/src/test/java/cd/go/plugin/config/yaml/transforms/StageTransformTest.java b/src/test/java/cd/go/plugin/config/yaml/transforms/StageTransformTest.java index 96c241a9..86bda4b4 100644 --- a/src/test/java/cd/go/plugin/config/yaml/transforms/StageTransformTest.java +++ b/src/test/java/cd/go/plugin/config/yaml/transforms/StageTransformTest.java @@ -35,6 +35,12 @@ public void shouldTransformShortApprovalStage() throws IOException { testTransform("short_approval"); } + @Test + public void shouldTransformSingleJobStage() throws IOException { + parser = new StageTransform(environmentTransform,new JobTransform(environmentTransform,mock(TaskTransform.class))); + testTransform("stage-job"); + } + private void testTransform(String caseFile) throws IOException { testTransform(caseFile,caseFile); } diff --git a/src/test/resources/parts/stages/stage-job.json b/src/test/resources/parts/stages/stage-job.json new file mode 100644 index 00000000..23740e41 --- /dev/null +++ b/src/test/resources/parts/stages/stage-job.json @@ -0,0 +1,17 @@ +{ + "name" : "build", + "approval" : { + "type" : "manual" + }, + "jobs" : [ + { + "name" : "build", + "resources" : [ + "cpp" + ], + "tasks" : [ + null + ] + } + ] +} diff --git a/src/test/resources/parts/stages/stage-job.yaml b/src/test/resources/parts/stages/stage-job.yaml new file mode 100644 index 00000000..a7710c64 --- /dev/null +++ b/src/test/resources/parts/stages/stage-job.yaml @@ -0,0 +1,7 @@ +build: + approval: manual + resources: + - cpp + tasks: + - exec: + command: make