Repository: authorjapps/zerocode
Pull request #295 (2019-08-13 08:49:09)

ISS-277 # YAML Scenario DSL - Unit and Integration
- Basic flow tested
- Optional DOuble Quoted String tested
- Json Path for Req and resp tested


Patch:
diff --git a/core/pom.xml b/core/pom.xml
index 3a98a82b..87b2df30 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -63,6 +63,10 @@
     </repositories>
 
     <dependencies>
+        <dependency>
+            <groupId>com.fasterxml.jackson.dataformat</groupId>
+            <artifactId>jackson-dataformat-yaml</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.univocity</groupId>
             <artifactId>univocity-parsers</artifactId>
diff --git a/core/src/main/java/org/jsmart/zerocode/core/di/module/ObjectMapperModule.java b/core/src/main/java/org/jsmart/zerocode/core/di/module/ObjectMapperModule.java
index 34f62289..0e062bca 100644
--- a/core/src/main/java/org/jsmart/zerocode/core/di/module/ObjectMapperModule.java
+++ b/core/src/main/java/org/jsmart/zerocode/core/di/module/ObjectMapperModule.java
@@ -3,16 +3,19 @@ package org.jsmart.zerocode.core.di.module;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.inject.Binder;
 import com.google.inject.Module;
+import com.google.inject.name.Names;
 import org.jsmart.zerocode.core.di.provider.ObjectMapperProvider;
-
 import javax.inject.Singleton;
-
+import org.jsmart.zerocode.core.di.provider.YamlObjectMapperProvider;
 
 public class ObjectMapperModule implements Module {
 
     @Override
     public void configure(Binder binder) {
         binder.bind(ObjectMapper.class).toProvider(ObjectMapperProvider.class).in(Singleton.class);
+        binder.bind(ObjectMapper.class)
+                .annotatedWith(Names.named("YamlMapper"))
+                .toProvider(YamlObjectMapperProvider.class).in(Singleton.class);
     }
 }
 
diff --git a/core/src/main/java/org/jsmart/zerocode/core/di/provider/YamlObjectMapperProvider.java b/core/src/main/java/org/jsmart/zerocode/core/di/provider/YamlObjectMapperProvider.java
new file mode 100644
index 00000000..897e2e44
--- /dev/null
+++ b/core/src/main/java/org/jsmart/zerocode/core/di/provider/YamlObjectMapperProvider.java
@@ -0,0 +1,19 @@
+package org.jsmart.zerocode.core.di.provider;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
+import javax.inject.Provider;
+
+public class YamlObjectMapperProvider implements Provider<ObjectMapper> {
+
+    @Override
+    public ObjectMapper get() {
+
+        ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory());
+        objectMapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
+
+        return objectMapper;
+    }
+
+}
diff --git a/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodePackageRunner.java b/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodePackageRunner.java
index 0692faa0..debdfa27 100644
--- a/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodePackageRunner.java
+++ b/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodePackageRunner.java
@@ -95,7 +95,7 @@ public class ZeroCodePackageRunner extends ParentRunner<ScenarioSpec> {
             return allEndPointFiles.stream()
                     .map(testResource -> {
                         try {
-                            return smartUtils.jsonFileToJava(testResource, ScenarioSpec.class);
+                            return smartUtils.scenarioFileToJava(testResource, ScenarioSpec.class);
                         } catch (IOException e) {
                             throw new RuntimeException("Exception while deserializing to Spec. Details: " + e);
                         }
diff --git a/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodeUnitRunner.java b/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodeUnitRunner.java
index ff2feec9..58f6b5f0 100644
--- a/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodeUnitRunner.java
+++ b/core/src/main/java/org/jsmart/zerocode/core/runner/ZeroCodeUnitRunner.java
@@ -199,7 +199,7 @@ public class ZeroCodeUnitRunner extends BlockJUnit4ClassRunner {
 
         ScenarioSpec child = null;
         try {
-            child = smartUtils.jsonFileToJava(currentTestCase, ScenarioSpec.class);
+            child = smartUtils.scenarioFileToJava(currentTestCase, ScenarioSpec.class);
 
             LOGGER.debug("### Found currentTestCase : -" + child);
 
diff --git a/core/src/main/java/org/jsmart/zerocode/core/utils/SmartUtils.java b/core/src/main/java/org/jsmart/zerocode/core/utils/SmartUtils.java
index 811525e0..5b06fcd1 100644
--- a/core/src/main/java/org/jsmart/zerocode/core/utils/SmartUtils.java
+++ b/core/src/main/java/org/jsmart/zerocode/core/utils/SmartUtils.java
@@ -9,6 +9,7 @@ import com.google.classpath.RegExpResourceFilter;
 import com.google.common.io.Resources;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
+import com.google.inject.name.Named;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
@@ -33,6 +34,9 @@ public class SmartUtils {
     @Inject
     private ObjectMapper mapper; //<--- remember the static methods can not use this objectMapper. So make the methods non-static if you want to use this objectMapper.
 
+    @Inject @Named("YamlMapper")
+    private ObjectMapper yamlMapper;
+
     public <T> String getItRight() throws IOException {
         String jsonAsString = mapper.toString();
         return jsonAsString;
@@ -43,14 +47,17 @@ public class SmartUtils {
         return jsonAsString;
     }
 
-    public static String readJsonAsString(String jsonFileName){
+    public static String readJsonAsString(String jsonFile){
         try {
-            return Resources.toString(Resources.getResource(jsonFileName), defaultCharset());
+            return Resources.toString(Resources.getResource(jsonFile), defaultCharset());
         } catch (IOException e) {
-            throw new RuntimeException("Exception occurred while reading the JSON file - " + jsonFileName);
+            throw new RuntimeException("Exception occurred while reading the JSON file - " + jsonFile);
         }
     }
 
+    public static String readYamlAsString(String yamlFile){
+        return readJsonAsString(yamlFile);
+    }
 
     public Map<String, Object> readJsonStringAsMap(String json) throws IOException {
         Map<String, Object> map = new HashMap<>();
@@ -71,8 +78,12 @@ public class SmartUtils {
     }
 
 
-    public <T> T jsonFileToJava(String jsonFileName, Class<T> clazz) throws IOException {
-        return mapper.readValue(readJsonAsString(jsonFileName), clazz);
+    public <T> T scenarioFileToJava(String scenarioFile, Class<T> clazz) throws IOException {
+        if(scenarioFile.endsWith(".yml") || scenarioFile.endsWith(".yaml")){
+            return yamlMapper.readValue(readYamlAsString(scenarioFile), clazz);
+        }
+
+        return mapper.readValue(readJsonAsString(scenarioFile), clazz);
     }
 
     public List<ScenarioSpec> getScenarioSpecListByPackage(String packageName) {
@@ -80,7 +91,7 @@ public class SmartUtils {
         List<ScenarioSpec> scenarioSpecList = allEndPointFiles.stream()
                 .map(testResource -> {
                     try {
-                        return jsonFileToJava(testResource, ScenarioSpec.class);
+                        return scenarioFileToJava(testResource, ScenarioSpec.class);
                     } catch (IOException e) {
                         throw new RuntimeException("Exception while deserializing to Spec. Details: " + e);
                     }
diff --git a/pom.xml b/pom.xml
index 1bada659..bda1b531 100644
--- a/pom.xml
+++ b/pom.xml
@@ -135,6 +135,11 @@
                 <artifactId>velocity</artifactId>
                 <version>${velocity.version}</version>
             </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.dataformat</groupId>
+                <artifactId>jackson-dataformat-yaml</artifactId>
+                <version>${jackson-dataformat-csv.version}</version>
+            </dependency>
             <dependency>
                 <groupId>com.fasterxml.jackson.dataformat</groupId>
                 <artifactId>jackson-dataformat-csv</artifactId>


Test patch:
diff --git a/core/src/test/java/org/jsmart/zerocode/core/domain/yaml/YamlParsingTest.java b/core/src/test/java/org/jsmart/zerocode/core/domain/yaml/YamlParsingTest.java
new file mode 100644
index 00000000..9a4d2e18
--- /dev/null
+++ b/core/src/test/java/org/jsmart/zerocode/core/domain/yaml/YamlParsingTest.java
@@ -0,0 +1,39 @@
+package org.jsmart.zerocode.core.domain.yaml;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import org.jsmart.zerocode.core.di.provider.YamlObjectMapperProvider;
+import org.jsmart.zerocode.core.domain.ScenarioSpec;
+import org.junit.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.jsmart.zerocode.core.utils.SmartUtils.readYamlAsString;
+
+public class YamlParsingTest {
+    ObjectMapper mapper = new YamlObjectMapperProvider().get();
+
+    @Test
+    public void testYaml_parsing() throws IOException {
+
+        ScenarioSpec scenarioSpec =
+                mapper.readValue(readYamlAsString("unit_test_files/yaml/scenario_get_api_test.yml"),
+                ScenarioSpec.class);
+
+        // steps
+        assertThat(scenarioSpec.getSteps().size(), is(1));
+        assertThat(scenarioSpec.getScenarioName(), is("A simple GET API Scenario"));
+        assertThat(scenarioSpec.getSteps().get(0).getUrl(), is("/api/v1/persons/p001"));
+
+        // headers
+        assertThat(scenarioSpec.getSteps().get(0).getRequest().get("headers").get("x-api-key").asText(), is("Ama-zing-key"));
+
+        // verifications
+        assertThat(scenarioSpec.getSteps().get(0).getVerifications().get("status").asInt(), is(200));
+        assertThat(scenarioSpec.getSteps().get(0).getVerifications().get("body").get("exactMatches").asBoolean(), is(true));
+        assertThat(scenarioSpec.getSteps().get(0).getVerifications().get("body").get("addresses").get(0).toString(),
+                is("{\"type\":\"office\",\"line1\":\"10 Random St\"}"));
+        assertThat(scenarioSpec.getSteps().get(0).getVerifications().get("body").get("addresses").get(1).toString(),
+                is("{\"type\":\"home\",\"line1\":\"300 Random St\"}"));
+    }
+}
diff --git a/core/src/test/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeAssertionsProcessorImplTest.java b/core/src/test/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeAssertionsProcessorImplTest.java
index b884bd29..cb0d1624 100644
--- a/core/src/test/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeAssertionsProcessorImplTest.java
+++ b/core/src/test/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeAssertionsProcessorImplTest.java
@@ -56,7 +56,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void willResolveWithParamMap() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/test_engine/01_request_with_place_holders.json", ScenarioSpec.class);
     final String requestJsonAsString = scenarioSpec.getSteps().get(0).getRequest().toString();
 
@@ -72,7 +72,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void willCaptureAllPlaceHolders() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/test_engine/01_request_with_place_holders.json", ScenarioSpec.class);
     final String requestJsonAsString = scenarioSpec.getSteps().get(0).getRequest().toString();
 
@@ -146,7 +146,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void willResolveJsonPathOfJayWayFor_AssertionSection() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/test_engine/02_1_two_requests_with_json_path_assertion.json", ScenarioSpec.class);
 
     // Get the 2nd step
@@ -302,7 +302,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testLocalDate_formatter() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/localdatetime/00_local_date_time_place_holders_unit_test.json", ScenarioSpec.class);
 
     final String requestJsonAsString = scenarioSpec.getSteps().get(0).getRequest().toString();
@@ -319,7 +319,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testLocalDateTime_formatter() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/localdatetime/00_local_date_time_place_holders_unit_test.json", ScenarioSpec.class);
 
     final String requestJsonAsString = scenarioSpec.getSteps().get(0).getRequest().toString();
@@ -355,7 +355,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testIgnoreCaseWith_containsNoMatch() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/ignore_case/test_string_match_withIgnoring_case.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -390,7 +390,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testIgnoreCaseWith_containsMatch() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/ignore_case/test_string_match_withIgnoring_case.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -421,7 +421,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testString_regexMatch() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava("unit_test_files/regex_match/string_matches_regex_test.json", ScenarioSpec.class);
+        smartUtils.scenarioFileToJava("unit_test_files/regex_match/string_matches_regex_test.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
         scenarioSpec.getSteps().get(0).getAssertions().toString();
@@ -452,7 +452,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testArraySize_numberOnly() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/array_size/array_size_number_only_test.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -489,7 +489,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testArraySize_numberOnlyNegative() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/array_size/array_size_number_only_test.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -523,7 +523,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testArraySize_expressionGT() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/array_size/array_size_expresssion_test_GT.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -560,7 +560,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testArraySize_expressionFailTest() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/array_size/array_size_expresssion_fail_test_GT.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -601,7 +601,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testArraySize_expressionLT() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/array_size/array_size_expresssion_test_LT.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -638,7 +638,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testArraySize_expressionFailLT() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/array_size/array_size_expresssion_test_fail_LT.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -679,7 +679,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testArraySize_expressionEQ() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/array_size/array_size_expresssion_test_EQ.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -716,7 +716,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testArraySize_expressionFailEQ() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/array_size/array_size_expresssion_test_fail_EQ.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -757,7 +757,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testArraySize_expressionNotEQ() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/array_size/array_size_expresssion_test_NotEQ.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -794,7 +794,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testArraySize_expressionFailNotEQ() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/array_size/array_size_expresssion_test_fail_NotEQ.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -835,7 +835,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testDateAfterBefore_both() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/date_after_before/dateAfterBefore_test_both.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -873,7 +873,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testDateAfterBefore_fail_both() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/date_after_before/dateAfterBefore_test_fail_both.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -922,7 +922,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testDateAfterBefore_fail_afterSameDate() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/date_after_before/dateAfterBefore_test_fail_afterSameDate.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -962,7 +962,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testDateAfterBefore_fail_beforeSameDate() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava(
+        smartUtils.scenarioFileToJava(
                 "unit_test_files/date_after_before/dateAfterBefore_test_fail_beforeSameDate.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
@@ -1002,7 +1002,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testValueOneOf_ValuePresent() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava("unit_test_files/one_of/oneOf_test_currentStatus.json", ScenarioSpec.class);
+        smartUtils.scenarioFileToJava("unit_test_files/one_of/oneOf_test_currentStatus.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
         scenarioSpec.getSteps().get(0).getAssertions().toString();
@@ -1033,7 +1033,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testValueOneOf_ValueNotPresent() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava("unit_test_files/one_of/oneOf_test_currentStatus.json", ScenarioSpec.class);
+        smartUtils.scenarioFileToJava("unit_test_files/one_of/oneOf_test_currentStatus.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
         scenarioSpec.getSteps().get(0).getAssertions().toString();
@@ -1064,7 +1064,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testValueOneOf_ActualResultNull() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava("unit_test_files/one_of/oneOf_test_currentStatus.json", ScenarioSpec.class);
+        smartUtils.scenarioFileToJava("unit_test_files/one_of/oneOf_test_currentStatus.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
         scenarioSpec.getSteps().get(0).getAssertions().toString();
@@ -1090,7 +1090,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testValueOneOf_MatchEmptyString() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava("unit_test_files/one_of/oneOf_test_emptyString.json", ScenarioSpec.class);
+        smartUtils.scenarioFileToJava("unit_test_files/one_of/oneOf_test_emptyString.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
         scenarioSpec.getSteps().get(0).getAssertions().toString();
@@ -1121,7 +1121,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testValueOneOf_MatchWhiteSpace() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava("unit_test_files/one_of/oneOf_test_whiteSpace.json", ScenarioSpec.class);
+        smartUtils.scenarioFileToJava("unit_test_files/one_of/oneOf_test_whiteSpace.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
         scenarioSpec.getSteps().get(0).getAssertions().toString();
@@ -1152,7 +1152,7 @@ public class ZeroCodeAssertionsProcessorImplTest {
   @Test
   public void testValueOneOf_ExpectedArrayEmpty() throws Exception {
     ScenarioSpec scenarioSpec =
-        smartUtils.jsonFileToJava("unit_test_files/one_of/oneOf_test_expectedArrayEmpty.json", ScenarioSpec.class);
+        smartUtils.scenarioFileToJava("unit_test_files/one_of/oneOf_test_expectedArrayEmpty.json", ScenarioSpec.class);
 
     final String assertionsSectionAsString =
         scenarioSpec.getSteps().get(0).getAssertions().toString();
diff --git a/core/src/test/java/org/jsmart/zerocode/core/utils/SmartUtilsTest.java b/core/src/test/java/org/jsmart/zerocode/core/utils/SmartUtilsTest.java
index a6181f78..00e6fd28 100644
--- a/core/src/test/java/org/jsmart/zerocode/core/utils/SmartUtilsTest.java
+++ b/core/src/test/java/org/jsmart/zerocode/core/utils/SmartUtilsTest.java
@@ -51,10 +51,10 @@ public class SmartUtilsTest {
 
     @Test
     public void testJsonToJavaFor_jsonFileName() throws Exception {
-        Step stepJava = smartUtils.jsonFileToJava("unit_test_files/engine_unit_test_jsons/01_test_json_single_step.json", Step.class);
+        Step stepJava = smartUtils.scenarioFileToJava("unit_test_files/engine_unit_test_jsons/01_test_json_single_step.json", Step.class);
         assertThat(stepJava.getLoop(), is(3));
 
-        ScenarioSpec scenarioJava = smartUtils.jsonFileToJava("unit_test_files/engine_unit_test_jsons/02_test_json_flow_single_step.json", ScenarioSpec.class);
+        ScenarioSpec scenarioJava = smartUtils.scenarioFileToJava("unit_test_files/engine_unit_test_jsons/02_test_json_flow_single_step.json", ScenarioSpec.class);
         assertThat(scenarioJava.getLoop(), is(5));
     }
 
diff --git a/core/src/test/java/org/jsmart/zerocode/core/yaml/YamlApiIntegrationTest.java b/core/src/test/java/org/jsmart/zerocode/core/yaml/YamlApiIntegrationTest.java
new file mode 100644
index 00000000..99b46a74
--- /dev/null
+++ b/core/src/test/java/org/jsmart/zerocode/core/yaml/YamlApiIntegrationTest.java
@@ -0,0 +1,46 @@
+package org.jsmart.zerocode.core.yaml;
+
+import org.jsmart.zerocode.core.domain.HostProperties;
+import org.jsmart.zerocode.core.domain.JsonTestCase;
+import org.jsmart.zerocode.core.domain.Scenario;
+import org.jsmart.zerocode.core.tests.customrunner.TestOnlyZeroCodeUnitRunner;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@HostProperties(host="http://localhost", port=9998, context = "")
+@RunWith(TestOnlyZeroCodeUnitRunner.class)
+public class YamlApiIntegrationTest {
+
+    /**
+     * Mock end points are in test/resources: simulators/test_purpose_end_points.json.
+     * @RunWith(TestOnlyZeroCodeUnitRunner.class) : starts these mocks first before running the tests
+     */
+
+    @Test
+    @JsonTestCase("integration_test_files/get_api/simple_get_api_test.json")
+    public void testSimpleGetApi_jsonSanity() throws Exception {
+    
+    }
+
+    @Test
+    @Scenario("integration_test_files/yaml/simple_get_api_test.yml")
+    public void testSimpleGetApi_yaml() throws Exception {
+
+    }
+
+    @Test
+    @Scenario("integration_test_files/yaml/string_optional_double_quotes_test.yml")
+    public void testSimpleGetApiOptional_doubleQuatedStringYaml() throws Exception {
+
+    }
+
+    @Test
+    @Scenario("integration_test_files/yaml/simple_get_api_multi_step_test.yml")
+    public void testSimpleGetApi_multiStepYaml() throws Exception {
+
+    }
+
+}
+
+
+
diff --git a/core/src/test/resources/integration_test_files/yaml/simple_get_api_multi_step_test.yml b/core/src/test/resources/integration_test_files/yaml/simple_get_api_multi_step_test.yml
new file mode 100644
index 00000000..ed4fd04f
--- /dev/null
+++ b/core/src/test/resources/integration_test_files/yaml/simple_get_api_multi_step_test.yml
@@ -0,0 +1,32 @@
+---
+scenarioName: As simple GET request response Multi STep
+steps:
+- name: find_match
+  url: "/api/v1/search/persons"
+  operation: GET
+  request:
+    queryParams:
+      lang: Amazing
+      city: Lon
+  assertions:
+    status: 200
+    body:
+      exactMatches: true
+      name: Mr Bean
+      lang: Amazing
+      city: Lon
+
+- name: find_match2
+  url: "/api/v1/search/persons"
+  operation: GET
+  request:
+    queryParams:
+      lang: Amazing
+      city: Lon
+  verifications:
+    status: "$EQ.${$.find_match.response.status}"
+    body:
+      exactMatches: true
+      name: "$CONTAINS.STRING:Bean"
+      lang: "${$.find_match.response.body.lang}"
+      city: "${$.find_match2.request.queryParams.city}"
\ No newline at end of file
diff --git a/core/src/test/resources/integration_test_files/yaml/simple_get_api_test.yml b/core/src/test/resources/integration_test_files/yaml/simple_get_api_test.yml
new file mode 100644
index 00000000..7af53cb0
--- /dev/null
+++ b/core/src/test/resources/integration_test_files/yaml/simple_get_api_test.yml
@@ -0,0 +1,17 @@
+---
+scenarioName: As simple GET request response
+steps:
+- name: find_match
+  url: "/api/v1/search/persons"
+  operation: GET
+  request:
+    queryParams:
+      lang: Amazing
+      city: Lon
+  verifications:
+    status: 200
+    body:
+      exactMatches: true
+      name: Mr Bean
+      lang: Amazing
+      city: Lon
\ No newline at end of file
diff --git a/core/src/test/resources/integration_test_files/yaml/string_optional_double_quotes_test.yml b/core/src/test/resources/integration_test_files/yaml/string_optional_double_quotes_test.yml
new file mode 100644
index 00000000..8d95a2a2
--- /dev/null
+++ b/core/src/test/resources/integration_test_files/yaml/string_optional_double_quotes_test.yml
@@ -0,0 +1,17 @@
+---
+scenarioName: As simple GET request response
+steps:
+- name: "find_match"
+  url: "/api/v1/search/persons"
+  operation: "GET"
+  request:
+    queryParams:
+      lang: "Amazing"
+      city: "Lon"
+  verifications:
+    status: 200
+    body:
+      exactMatches: true
+      name: "Mr Bean"
+      lang: "Amazing"
+      city: "Lon"
\ No newline at end of file
diff --git a/core/src/test/resources/unit_test_files/yaml/scenario_get_api_test.yml b/core/src/test/resources/unit_test_files/yaml/scenario_get_api_test.yml
new file mode 100644
index 00000000..8e67c4ab
--- /dev/null
+++ b/core/src/test/resources/unit_test_files/yaml/scenario_get_api_test.yml
@@ -0,0 +1,20 @@
+---
+scenarioName: "A simple GET API Scenario" #comments allowed
+steps:
+- name: "find_match"
+  url: "/api/v1/persons/p001"
+  operation: "GET"
+  request:
+    headers:
+      x-api-key: "Ama-zing-key"
+      x-api-secret: "Sec-ret-stuff"
+  verifications:
+    status: 200 #comment - a http status code as int value
+    body:
+      exactMatches: true
+      name: "Mr Bean"
+      addresses:
+      - type: "office"
+        line1: "10 Random St"
+      - type: "home"
+        line1: "300 Random St"
\ No newline at end of file