Repository: authorjapps/zerocode
Pull request #118 (2018-08-19 13:47:10)

ISSUE-117 #Array Size supports expression


Patch:
diff --git a/src/main/java/org/jsmart/zerocode/core/engine/assertion/ArraySizeAsserter.java b/src/main/java/org/jsmart/zerocode/core/engine/assertion/ArraySizeAsserter.java
index 4f459df8..5b93abe6 100644
--- a/src/main/java/org/jsmart/zerocode/core/engine/assertion/ArraySizeAsserter.java
+++ b/src/main/java/org/jsmart/zerocode/core/engine/assertion/ArraySizeAsserter.java
@@ -2,13 +2,23 @@ package org.jsmart.zerocode.core.engine.assertion;
 
 import net.minidev.json.JSONArray;
 
+import static org.jsmart.zerocode.core.engine.preprocessor.ZeroCodeJsonTestProcesorImpl.*;
+
 public class ArraySizeAsserter implements JsonAsserter {
     private final String path;
     private final int expectedSize;
+    private final String expectedSizeExpression;
 
     public ArraySizeAsserter(String path, int size) {
         this.path = path;
         expectedSize = size;
+        expectedSizeExpression = null;
+    }
+
+    public ArraySizeAsserter(String path, String expression) {
+        this.path = path;
+        expectedSizeExpression = expression;
+        expectedSize = -1;
     }
 
     @Override
@@ -22,6 +32,12 @@ public class ArraySizeAsserter implements JsonAsserter {
 
             final JSONArray actualArrayValue = (JSONArray) result;
 
+            if (this.expectedSize == -1 && this.expectedSizeExpression != null) {
+
+                return processRelationalExpression(actualArrayValue);
+
+            }
+
             if (actualArrayValue.size() == this.expectedSize) {
 
                 return AssertionReport.createFieldMatchesReport();
@@ -39,4 +55,34 @@ public class ArraySizeAsserter implements JsonAsserter {
         }
     }
 
+    public AssertionReport processRelationalExpression(JSONArray actualArrayValue) {
+        if (expectedSizeExpression.startsWith(ASSERT_VALUE_GREATER_THAN)) {
+            String greaterThan = this.expectedSizeExpression.substring(ASSERT_VALUE_GREATER_THAN.length());
+            if (actualArrayValue.size() > Integer.parseInt(greaterThan)) {
+                return AssertionReport.createFieldMatchesReport();
+            }
+        } else if (expectedSizeExpression.startsWith(ASSERT_VALUE_LESSER_THAN)) {
+            String lesserThan = this.expectedSizeExpression.substring(ASSERT_VALUE_LESSER_THAN.length());
+            if (actualArrayValue.size() < Integer.parseInt(lesserThan)) {
+                return AssertionReport.createFieldMatchesReport();
+            }
+        } else if (expectedSizeExpression.startsWith(ASSERT_VALUE_EQUAL_TO_NUMBER)) {
+            String equalTo = this.expectedSizeExpression.substring(ASSERT_VALUE_EQUAL_TO_NUMBER.length());
+            if (actualArrayValue.size() == Integer.parseInt(equalTo)) {
+                return AssertionReport.createFieldMatchesReport();
+            }
+        } else if (expectedSizeExpression.startsWith(ASSERT_VALUE_NOT_EQUAL_TO_NUMBER)) {
+            String notEqualTo = this.expectedSizeExpression.substring(ASSERT_VALUE_NOT_EQUAL_TO_NUMBER.length());
+            if (actualArrayValue.size() != Integer.parseInt(notEqualTo)) {
+                return AssertionReport.createFieldMatchesReport();
+            }
+        }
+
+        return AssertionReport.createFieldDoesNotMatchReport(
+                path,
+                String.format("Array of size %s", expectedSizeExpression),
+                actualArrayValue.size());
+    }
+
+
 }


Test patch:
diff --git a/src/main/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeJsonTestProcesorImpl.java b/src/main/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeJsonTestProcesorImpl.java
index f79f979b..27417cf4 100644
--- a/src/main/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeJsonTestProcesorImpl.java
+++ b/src/main/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeJsonTestProcesorImpl.java
@@ -228,7 +228,13 @@ public class ZeroCodeJsonTestProcesorImpl implements ZeroCodeJsonTestProcesor {
                 }
                 else if (path.endsWith(ASSERT_PATH_SIZE)) {
                     path = path.substring(0, path.length() - ASSERT_PATH_SIZE.length());
-                    asserter = new ArraySizeAsserter(path, ((Integer) value).intValue());
+                    if(value instanceof Number){
+                        asserter = new ArraySizeAsserter(path, ((Integer) value).intValue());
+                    } else if(value instanceof String){
+                        asserter = new ArraySizeAsserter(path, (String)value);
+                    } else {
+                        throw new RuntimeException(format("Oops! Unsupported value for .SIZE: %s", value));
+                    }
                 }
                 else if (value instanceof String && ((String) value).startsWith(ASSERT_VALUE_CONTAINS_STRING)) {
                     String expected = ((String) value).substring(ASSERT_VALUE_CONTAINS_STRING.length());
diff --git a/src/test/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeJsonTestProcesorImplTest.java b/src/test/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeJsonTestProcesorImplTest.java
index 5669a772..b881c84c 100644
--- a/src/test/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeJsonTestProcesorImplTest.java
+++ b/src/test/java/org/jsmart/zerocode/core/engine/preprocessor/ZeroCodeJsonTestProcesorImplTest.java
@@ -451,4 +451,276 @@ public class ZeroCodeJsonTestProcesorImplTest {
 
         assertThat(failedReports.size(), is(1));
     }
+
+    @Test
+    public void testArraySize_expressionGT() throws Exception {
+        ScenarioSpec scenarioSpec = smartUtils.jsonFileToJava(
+                "array_size/array_size_expresssion_test_GT.json",
+                ScenarioSpec.class);
+
+        final String assertionsSectionAsString = scenarioSpec.getSteps().get(0).getAssertions().toString();
+        String mockScenarioState = "{}";
+
+        final String resolvedAssertions = jsonPreProcessor.resolveStringJson(assertionsSectionAsString, mockScenarioState);
+        assertThat(resolvedAssertions, containsString("{\"persons.SIZE\":\"$GT.1\"}"));
+
+        List<JsonAsserter> asserters = jsonPreProcessor.createAssertersFrom(resolvedAssertions);
+        assertThat(asserters.size(), is(2));
+
+        String mockTestResponse = "{\n" +
+                "    \"status\": 201,\n" +
+                "    \"body\": {\n" +
+                "        \"persons\": [\n" +
+                "            {\n" +
+                "                \"name\": \"Tom\"\n" +
+                "            },\n" +
+                "            {\n" +
+                "                \"name\": \"Mady\"\n" +
+                "            }\n" +
+                "        ]\n" +
+                "    }\n" +
+                "}";
+        List<AssertionReport> failedReports = jsonPreProcessor.assertAllAndReturnFailed(asserters, mockTestResponse);
+
+        assertThat(failedReports.size(), is(0));
+    }
+
+    @Test
+    public void testArraySize_expressionFailTest() throws Exception {
+        ScenarioSpec scenarioSpec = smartUtils.jsonFileToJava(
+                "array_size/array_size_expresssion_fail_test_GT.json",
+                ScenarioSpec.class);
+
+        final String assertionsSectionAsString = scenarioSpec.getSteps().get(0).getAssertions().toString();
+        String mockScenarioState = "{}";
+
+        final String resolvedAssertions = jsonPreProcessor.resolveStringJson(assertionsSectionAsString, mockScenarioState);
+        assertThat(resolvedAssertions, containsString("{\"persons.SIZE\":\"$GT.5\"}"));
+
+        List<JsonAsserter> asserters = jsonPreProcessor.createAssertersFrom(resolvedAssertions);
+        assertThat(asserters.size(), is(2));
+
+        String mockTestResponse = "{\n" +
+                "    \"status\": 201,\n" +
+                "    \"body\": {\n" +
+                "        \"persons\": [\n" +
+                "            {\n" +
+                "                \"name\": \"Tom\"\n" +
+                "            },\n" +
+                "            {\n" +
+                "                \"name\": \"Mady\"\n" +
+                "            }\n" +
+                "        ]\n" +
+                "    }\n" +
+                "}";
+        List<AssertionReport> failedReports = jsonPreProcessor.assertAllAndReturnFailed(asserters, mockTestResponse);
+
+        assertThat(failedReports.size(), is(1));
+        assertThat(failedReports.get(0).toString(),
+                is("Assertion path '$.body.persons' with actual value '2' did not match the expected value 'Array of size $GT.5'"));
+    }
+
+    @Test
+    public void testArraySize_expressionLT() throws Exception {
+        ScenarioSpec scenarioSpec = smartUtils.jsonFileToJava(
+                "array_size/array_size_expresssion_test_LT.json",
+                ScenarioSpec.class);
+
+        final String assertionsSectionAsString = scenarioSpec.getSteps().get(0).getAssertions().toString();
+        String mockScenarioState = "{}";
+
+        final String resolvedAssertions = jsonPreProcessor.resolveStringJson(assertionsSectionAsString, mockScenarioState);
+        assertThat(resolvedAssertions, containsString("{\"persons.SIZE\":\"$LT.3\"}"));
+
+        List<JsonAsserter> asserters = jsonPreProcessor.createAssertersFrom(resolvedAssertions);
+        assertThat(asserters.size(), is(2));
+
+        String mockTestResponse = "{\n" +
+                "    \"status\": 201,\n" +
+                "    \"body\": {\n" +
+                "        \"persons\": [\n" +
+                "            {\n" +
+                "                \"name\": \"Tom\"\n" +
+                "            },\n" +
+                "            {\n" +
+                "                \"name\": \"Mady\"\n" +
+                "            }\n" +
+                "        ]\n" +
+                "    }\n" +
+                "}";
+        List<AssertionReport> failedReports = jsonPreProcessor.assertAllAndReturnFailed(asserters, mockTestResponse);
+
+        assertThat(failedReports.size(), is(0));
+    }
+
+    @Test
+    public void testArraySize_expressionFailLT() throws Exception {
+        ScenarioSpec scenarioSpec = smartUtils.jsonFileToJava(
+                "array_size/array_size_expresssion_test_fail_LT.json",
+                ScenarioSpec.class);
+
+        final String assertionsSectionAsString = scenarioSpec.getSteps().get(0).getAssertions().toString();
+        String mockScenarioState = "{}";
+
+        final String resolvedAssertions = jsonPreProcessor.resolveStringJson(assertionsSectionAsString, mockScenarioState);
+        assertThat(resolvedAssertions, containsString("{\"persons.SIZE\":\"$LT.1\"}"));
+
+        List<JsonAsserter> asserters = jsonPreProcessor.createAssertersFrom(resolvedAssertions);
+        assertThat(asserters.size(), is(2));
+
+        String mockTestResponse = "{\n" +
+                "    \"status\": 201,\n" +
+                "    \"body\": {\n" +
+                "        \"persons\": [\n" +
+                "            {\n" +
+                "                \"name\": \"Tom\"\n" +
+                "            },\n" +
+                "            {\n" +
+                "                \"name\": \"Mady\"\n" +
+                "            }\n" +
+                "        ]\n" +
+                "    }\n" +
+                "}";
+        List<AssertionReport> failedReports = jsonPreProcessor.assertAllAndReturnFailed(asserters, mockTestResponse);
+
+        assertThat(failedReports.size(), is(1));
+        assertThat(failedReports.get(0).toString(),
+                is("Assertion path '$.body.persons' with actual value '2' did not match the expected value 'Array of size $LT.1'"));
+    }
+
+    @Test
+    public void testArraySize_expressionEQ() throws Exception {
+        ScenarioSpec scenarioSpec = smartUtils.jsonFileToJava(
+                "array_size/array_size_expresssion_test_EQ.json",
+                ScenarioSpec.class);
+
+        final String assertionsSectionAsString = scenarioSpec.getSteps().get(0).getAssertions().toString();
+        String mockScenarioState = "{}";
+
+        final String resolvedAssertions = jsonPreProcessor.resolveStringJson(assertionsSectionAsString, mockScenarioState);
+        assertThat(resolvedAssertions, containsString("{\"persons.SIZE\":\"$EQ.2\"}"));
+
+        List<JsonAsserter> asserters = jsonPreProcessor.createAssertersFrom(resolvedAssertions);
+        assertThat(asserters.size(), is(2));
+
+        String mockTestResponse = "{\n" +
+                "    \"status\": 201,\n" +
+                "    \"body\": {\n" +
+                "        \"persons\": [\n" +
+                "            {\n" +
+                "                \"name\": \"Tom\"\n" +
+                "            },\n" +
+                "            {\n" +
+                "                \"name\": \"Mady\"\n" +
+                "            }\n" +
+                "        ]\n" +
+                "    }\n" +
+                "}";
+        List<AssertionReport> failedReports = jsonPreProcessor.assertAllAndReturnFailed(asserters, mockTestResponse);
+
+        assertThat(failedReports.size(), is(0));
+    }
+
+    @Test
+    public void testArraySize_expressionFailEQ() throws Exception {
+        ScenarioSpec scenarioSpec = smartUtils.jsonFileToJava(
+                "array_size/array_size_expresssion_test_fail_EQ.json",
+                ScenarioSpec.class);
+
+        final String assertionsSectionAsString = scenarioSpec.getSteps().get(0).getAssertions().toString();
+        String mockScenarioState = "{}";
+
+        final String resolvedAssertions = jsonPreProcessor.resolveStringJson(assertionsSectionAsString, mockScenarioState);
+        assertThat(resolvedAssertions, containsString("{\"persons.SIZE\":\"$EQ.3\"}"));
+
+        List<JsonAsserter> asserters = jsonPreProcessor.createAssertersFrom(resolvedAssertions);
+        assertThat(asserters.size(), is(2));
+
+        String mockTestResponse = "{\n" +
+                "    \"status\": 201,\n" +
+                "    \"body\": {\n" +
+                "        \"persons\": [\n" +
+                "            {\n" +
+                "                \"name\": \"Tom\"\n" +
+                "            },\n" +
+                "            {\n" +
+                "                \"name\": \"Mady\"\n" +
+                "            }\n" +
+                "        ]\n" +
+                "    }\n" +
+                "}";
+        List<AssertionReport> failedReports = jsonPreProcessor.assertAllAndReturnFailed(asserters, mockTestResponse);
+
+        assertThat(failedReports.size(), is(1));
+        assertThat(failedReports.get(0).toString(),
+                is("Assertion path '$.body.persons' with actual value '2' did not match the expected value 'Array of size $EQ.3'"));
+    }
+
+    @Test
+    public void testArraySize_expressionNotEQ() throws Exception {
+        ScenarioSpec scenarioSpec = smartUtils.jsonFileToJava(
+                "array_size/array_size_expresssion_test_NotEQ.json",
+                ScenarioSpec.class);
+
+        final String assertionsSectionAsString = scenarioSpec.getSteps().get(0).getAssertions().toString();
+        String mockScenarioState = "{}";
+
+        final String resolvedAssertions = jsonPreProcessor.resolveStringJson(assertionsSectionAsString, mockScenarioState);
+        assertThat(resolvedAssertions, containsString("{\"persons.SIZE\":\"$NOT.EQ.3\"}"));
+
+        List<JsonAsserter> asserters = jsonPreProcessor.createAssertersFrom(resolvedAssertions);
+        assertThat(asserters.size(), is(2));
+
+        String mockTestResponse = "{\n" +
+                "    \"status\": 201,\n" +
+                "    \"body\": {\n" +
+                "        \"persons\": [\n" +
+                "            {\n" +
+                "                \"name\": \"Tom\"\n" +
+                "            },\n" +
+                "            {\n" +
+                "                \"name\": \"Mady\"\n" +
+                "            }\n" +
+                "        ]\n" +
+                "    }\n" +
+                "}";
+        List<AssertionReport> failedReports = jsonPreProcessor.assertAllAndReturnFailed(asserters, mockTestResponse);
+
+        assertThat(failedReports.size(), is(0));
+    }
+
+    @Test
+    public void testArraySize_expressionFailNotEQ() throws Exception {
+        ScenarioSpec scenarioSpec = smartUtils.jsonFileToJava(
+                "array_size/array_size_expresssion_test_fail_NotEQ.json",
+                ScenarioSpec.class);
+
+        final String assertionsSectionAsString = scenarioSpec.getSteps().get(0).getAssertions().toString();
+        String mockScenarioState = "{}";
+
+        final String resolvedAssertions = jsonPreProcessor.resolveStringJson(assertionsSectionAsString, mockScenarioState);
+        assertThat(resolvedAssertions, containsString("{\"persons.SIZE\":\"$NOT.EQ.2\"}"));
+
+        List<JsonAsserter> asserters = jsonPreProcessor.createAssertersFrom(resolvedAssertions);
+        assertThat(asserters.size(), is(2));
+
+        String mockTestResponse = "{\n" +
+                "    \"status\": 201,\n" +
+                "    \"body\": {\n" +
+                "        \"persons\": [\n" +
+                "            {\n" +
+                "                \"name\": \"Tom\"\n" +
+                "            },\n" +
+                "            {\n" +
+                "                \"name\": \"Mady\"\n" +
+                "            }\n" +
+                "        ]\n" +
+                "    }\n" +
+                "}";
+        List<AssertionReport> failedReports = jsonPreProcessor.assertAllAndReturnFailed(asserters, mockTestResponse);
+
+        assertThat(failedReports.size(), is(1));
+        assertThat(failedReports.get(0).toString(),
+                is("Assertion path '$.body.persons' with actual value '2' did not match the expected value 'Array of size $NOT.EQ.2'"));
+    }
 }
\ No newline at end of file
diff --git a/src/test/resources/array_size/array_size_expresssion_fail_test_GT.json b/src/test/resources/array_size/array_size_expresssion_fail_test_GT.json
new file mode 100644
index 00000000..c596c143
--- /dev/null
+++ b/src/test/resources/array_size/array_size_expresssion_fail_test_GT.json
@@ -0,0 +1,28 @@
+{
+    "scenarioName": "Array SIZE assert expression fail test GT",
+    "steps": [
+        {
+            "name": "StepNameWithoutSpaceEgCREATESD",
+            "url": "/persons",
+            "operation": "POST",
+            "request": {
+                "body": {
+                    "persons": [
+                        {
+                            "name": "Tom"
+                        },
+                        {
+                            "name": "Mady"
+                        }
+                    ]
+                }
+            },
+            "assertions": {
+                "status": 201,
+                "body": {
+                    "persons.SIZE": "$GT.5"
+                }
+            }
+        }
+    ]
+}
diff --git a/src/test/resources/array_size/array_size_expresssion_test_EQ.json b/src/test/resources/array_size/array_size_expresssion_test_EQ.json
new file mode 100644
index 00000000..b8c2420c
--- /dev/null
+++ b/src/test/resources/array_size/array_size_expresssion_test_EQ.json
@@ -0,0 +1,28 @@
+{
+    "scenarioName": "Array SIZE assert expression test EQ",
+    "steps": [
+        {
+            "name": "StepNameArraySizeEQExpression",
+            "url": "/persons",
+            "operation": "POST",
+            "request": {
+                "body": {
+                    "persons": [
+                        {
+                            "name": "Tom"
+                        },
+                        {
+                            "name": "Mady"
+                        }
+                    ]
+                }
+            },
+            "assertions": {
+                "status": 201,
+                "body": {
+                    "persons.SIZE": "$EQ.2"
+                }
+            }
+        }
+    ]
+}
diff --git a/src/test/resources/array_size/array_size_expresssion_test_GT.json b/src/test/resources/array_size/array_size_expresssion_test_GT.json
new file mode 100644
index 00000000..a7a74ff1
--- /dev/null
+++ b/src/test/resources/array_size/array_size_expresssion_test_GT.json
@@ -0,0 +1,28 @@
+{
+    "scenarioName": "Array SIZE assert expression test GT",
+    "steps": [
+        {
+            "name": "StepNameWithoutSpaceEgCREATESD",
+            "url": "/persons",
+            "operation": "POST",
+            "request": {
+                "body": {
+                    "persons": [
+                        {
+                            "name": "Tom"
+                        },
+                        {
+                            "name": "Mady"
+                        }
+                    ]
+                }
+            },
+            "assertions": {
+                "status": 201,
+                "body": {
+                    "persons.SIZE": "$GT.1"
+                }
+            }
+        }
+    ]
+}
diff --git a/src/test/resources/array_size/array_size_expresssion_test_LT.json b/src/test/resources/array_size/array_size_expresssion_test_LT.json
new file mode 100644
index 00000000..5488f273
--- /dev/null
+++ b/src/test/resources/array_size/array_size_expresssion_test_LT.json
@@ -0,0 +1,28 @@
+{
+    "scenarioName": "Array SIZE assert expression test LT",
+    "steps": [
+        {
+            "name": "StepNameWithoutSpaceEgCREATESD",
+            "url": "/persons",
+            "operation": "POST",
+            "request": {
+                "body": {
+                    "persons": [
+                        {
+                            "name": "Tom"
+                        },
+                        {
+                            "name": "Mady"
+                        }
+                    ]
+                }
+            },
+            "assertions": {
+                "status": 201,
+                "body": {
+                    "persons.SIZE": "$LT.3"
+                }
+            }
+        }
+    ]
+}
diff --git a/src/test/resources/array_size/array_size_expresssion_test_NotEQ.json b/src/test/resources/array_size/array_size_expresssion_test_NotEQ.json
new file mode 100644
index 00000000..078238fa
--- /dev/null
+++ b/src/test/resources/array_size/array_size_expresssion_test_NotEQ.json
@@ -0,0 +1,28 @@
+{
+    "scenarioName": "Array SIZE assert expression test Not EQ",
+    "steps": [
+        {
+            "name": "StepNameArraySizeNotEQExpression",
+            "url": "/persons",
+            "operation": "POST",
+            "request": {
+                "body": {
+                    "persons": [
+                        {
+                            "name": "Tom"
+                        },
+                        {
+                            "name": "Mady"
+                        }
+                    ]
+                }
+            },
+            "assertions": {
+                "status": 201,
+                "body": {
+                    "persons.SIZE": "$NOT.EQ.3"
+                }
+            }
+        }
+    ]
+}
diff --git a/src/test/resources/array_size/array_size_expresssion_test_fail_EQ.json b/src/test/resources/array_size/array_size_expresssion_test_fail_EQ.json
new file mode 100644
index 00000000..7a19b293
--- /dev/null
+++ b/src/test/resources/array_size/array_size_expresssion_test_fail_EQ.json
@@ -0,0 +1,28 @@
+{
+    "scenarioName": "Array SIZE assert fail expression test EQ",
+    "steps": [
+        {
+            "name": "StepNameArraySizeFailEQExpression",
+            "url": "/persons",
+            "operation": "POST",
+            "request": {
+                "body": {
+                    "persons": [
+                        {
+                            "name": "Tom"
+                        },
+                        {
+                            "name": "Mady"
+                        }
+                    ]
+                }
+            },
+            "assertions": {
+                "status": 201,
+                "body": {
+                    "persons.SIZE": "$EQ.3"
+                }
+            }
+        }
+    ]
+}
diff --git a/src/test/resources/array_size/array_size_expresssion_test_fail_LT.json b/src/test/resources/array_size/array_size_expresssion_test_fail_LT.json
new file mode 100644
index 00000000..91e44c82
--- /dev/null
+++ b/src/test/resources/array_size/array_size_expresssion_test_fail_LT.json
@@ -0,0 +1,28 @@
+{
+    "scenarioName": "Array SIZE assert expression test Fail LT",
+    "steps": [
+        {
+            "name": "StepNameWithoutSpaceEgCREATESD",
+            "url": "/persons",
+            "operation": "POST",
+            "request": {
+                "body": {
+                    "persons": [
+                        {
+                            "name": "Tom"
+                        },
+                        {
+                            "name": "Mady"
+                        }
+                    ]
+                }
+            },
+            "assertions": {
+                "status": 201,
+                "body": {
+                    "persons.SIZE": "$LT.1"
+                }
+            }
+        }
+    ]
+}
diff --git a/src/test/resources/array_size/array_size_expresssion_test_fail_NotEQ.json b/src/test/resources/array_size/array_size_expresssion_test_fail_NotEQ.json
new file mode 100644
index 00000000..80aa75af
--- /dev/null
+++ b/src/test/resources/array_size/array_size_expresssion_test_fail_NotEQ.json
@@ -0,0 +1,28 @@
+{
+    "scenarioName": "Array SIZE assert expression test fail Not EQ",
+    "steps": [
+        {
+            "name": "StepNameArraySizeFailNotEQExpression",
+            "url": "/persons",
+            "operation": "POST",
+            "request": {
+                "body": {
+                    "persons": [
+                        {
+                            "name": "Tom"
+                        },
+                        {
+                            "name": "Mady"
+                        }
+                    ]
+                }
+            },
+            "assertions": {
+                "status": 201,
+                "body": {
+                    "persons.SIZE": "$NOT.EQ.2"
+                }
+            }
+        }
+    ]
+}