From 9a51c0c616b9c2b23602956bfd3de54c69035c52 Mon Sep 17 00:00:00 2001 From: Jon Harris Date: Wed, 16 Oct 2019 10:21:53 +0100 Subject: [PATCH 01/10] feat(#1456): make nullable false by default on FieldDTO --- .../src/main/java/com/scottlogic/deg/profile/dtos/FieldDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile/src/main/java/com/scottlogic/deg/profile/dtos/FieldDTO.java b/profile/src/main/java/com/scottlogic/deg/profile/dtos/FieldDTO.java index f115e9876..b9cc0abfc 100644 --- a/profile/src/main/java/com/scottlogic/deg/profile/dtos/FieldDTO.java +++ b/profile/src/main/java/com/scottlogic/deg/profile/dtos/FieldDTO.java @@ -23,5 +23,5 @@ public class FieldDTO { public SpecificFieldType type; public String formatting; public boolean unique; - public boolean nullable = true; + public boolean nullable = false; } From 4b258e8e86e09dc4dbabe6babdee14af88ca602a Mon Sep 17 00:00:00 2001 From: Jon Harris Date: Wed, 16 Oct 2019 10:23:22 +0100 Subject: [PATCH 02/10] Update documentation for nullable fields --- docs/GettingStarted.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/GettingStarted.md b/docs/GettingStarted.md index 15fca751b..60636246e 100644 --- a/docs/GettingStarted.md +++ b/docs/GettingStarted.md @@ -142,15 +142,6 @@ firstName [...] ``` -Fields are nullable by default, however, you can add a further constraint to a field to indicate it is 'not null'. If you add the following constraint, the generator will no longer output null values: - -```json -"constraints": [ - { "field": "firstName", "is": "matchingRegex", "value": "[a-z]{1,10}" }, - { "not": { "field": "firstName", "is": "null" } } -] -``` - The generator supports three different types of constraint. These are: - **Predicates** - boolean-valued functions that define whether a given value is valid or invalid. In the above profile `ofType` and `matchingRegex` are examples of predicates. @@ -313,6 +304,16 @@ firstName,age,nationalInsurance [...] ``` +Fields are non-nullable by default, however, you can indicate that a field is nullable: + +```json +{ + "name": "field1", + "type": "datetime", + "nullable": true +} +``` + You can find out more about the various constraints the generator supports in the detailed [User Guide](UserGuide.md). ## Generation modes From 55d1bd4d21ce1a870a17642d13c84be268c08f69 Mon Sep 17 00:00:00 2001 From: JHarrisSL Date: Mon, 21 Oct 2019 11:31:01 +0100 Subject: [PATCH 03/10] Rename cucumber step thereIsAField so there is now thereIsANullableField and thereIsANonNullableField --- docs/DeveloperGuide.md | 2 +- docs/archive/developer/CucumberSyntax.md | 4 +- docs/developer/CucumberCookbook.md | 2 +- .../cucumber/features/Random.feature | 2 +- .../cucumber/features/Unique.feature | 16 +- .../cucumber/features/Violation.feature | 2 +- .../operators/general/EqualTo.feature | 58 ++--- .../operators/general/FormattedAs.feature | 2 +- .../features/operators/general/InSet.feature | 244 +++++++++--------- .../features/operators/general/Null.feature | 2 +- .../features/operators/general/OfType.feature | 30 +-- .../general/OfTypeFinancialCodes.feature | 2 +- .../operators/general/OfTypeNames.feature | 2 +- .../operators/grammatical/AllOf.feature | 8 +- .../operators/grammatical/AnyOf.feature | 2 +- .../numeric/FieldDependencies.feature | 4 +- .../numeric/GranularTo-Decimal.feature | 4 +- .../operators/numeric/GreaterThan.feature | 2 +- .../numeric/GreaterThanOrEqualTo.feature | 2 +- .../operators/numeric/LessThan.feature | 2 +- .../numeric/LessThanOrEqualTo.feature | 2 +- .../operators/string/CharacterSet.feature | 2 +- .../operators/string/ContainingRegex.feature | 2 +- .../operators/string/LongerThan.feature | 2 +- .../string/MatchingRegex-SpecialChars.feature | 2 +- .../operators/string/MatchingRegex.feature | 8 +- .../operators/string/OfLength.feature | 2 +- .../operators/string/ShorterThan.feature | 2 +- .../features/operators/temporal/After.feature | 2 +- .../operators/temporal/AfterOrAt.feature | 2 +- .../operators/temporal/Before.feature | 2 +- .../operators/temporal/BeforeOrAt.feature | 2 +- .../DateTimeOtherField-Multiple.feature | 6 +- .../temporal/DateTimeOtherField.feature | 4 +- .../temporal/GranularTo-DateTime.feature | 2 +- .../cucumber/features/types/Decimal.feature | 2 +- .../cucumber/features/types/Integer.feature | 2 +- .../features/validation/TypeMandation.feature | 12 +- .../testframework/steps/GeneralTestStep.java | 13 +- .../utils/CucumberTestState.java | 9 +- 40 files changed, 242 insertions(+), 230 deletions(-) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 6ed5794d2..91720bb2a 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -91,7 +91,7 @@ Feature: the name of my feature Background: Given the generation strategy is interesting - And there is a field foo + And there is a non nullable field foo Scenario: Running the generator should emit the correct data Given foo is equal to 8 diff --git a/docs/archive/developer/CucumberSyntax.md b/docs/archive/developer/CucumberSyntax.md index 56b0d2e03..aff54af02 100644 --- a/docs/archive/developer/CucumberSyntax.md +++ b/docs/archive/developer/CucumberSyntax.md @@ -7,7 +7,7 @@ Feature: the name of my feature Background: Given the generation strategy is interesting - And there is a field foo + And there is a non nullable field foo Scenario: Running the generator should emit the correct data Given foo is equal to 8 @@ -37,7 +37,7 @@ foo is greaterThan 5 Operators are converted to English language equivalents for use in cucumber, so 'greaterThan' is expressed as 'greater than'. -* _there is a field `{field}`_, adds a field called `field` to the profile +* _there is a non nullable field `{field}`_, adds a field called `field` to the profile * _the following fields exist:_, adds a set of fields to the profile (is followed by a single column set of strings, each represents a field name) * _`{field}` is null_, adds a null constraint to the profile for the field `field` * _`{field}` is anything but null_, adds a not(is null) constraint to the profile for field `field` diff --git a/docs/developer/CucumberCookbook.md b/docs/developer/CucumberCookbook.md index c49276dd8..e1419dc5c 100644 --- a/docs/developer/CucumberCookbook.md +++ b/docs/developer/CucumberCookbook.md @@ -19,7 +19,7 @@ foo is greaterThan 5 Operators are converted to English language equivalents for use in cucumber, so 'greaterThan' is expressed as 'greater than'. -* _there is a field `{field}`_, adds a field called `field` to the profile +* _there is a non nullable field `{field}`_, adds a field called `field` to the profile * _the following fields exist:_, adds a set of fields to the profile (is followed by a single column set of strings, each represents a field name) * _`{field}` is null_, adds a null constraint to the profile for the field `field` * _`{field}` is anything but null_, adds a not(is null) constraint to the profile for field `field` diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature index a54a2b329..0276288e5 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature @@ -2,7 +2,7 @@ Feature: User can generate valid data for all types (string, integer, decimal, o Background: Given the generation strategy is random - And there is a field foo + And there is a non nullable field foo Scenario: The generator produces valid 'DateTime' data in random mode Given foo has type "datetime" diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Unique.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Unique.feature index 04c101556..f59a902cb 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Unique.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Unique.feature @@ -3,7 +3,7 @@ Feature: As a user So that I can avoid duplication issues for certain fields Background: - Given there is a field unique + Given there is a non nullable field unique And unique is unique And unique has type "integer" And unique is greater than 0 @@ -12,12 +12,12 @@ Feature: As a user And the generator can generate at most 5 rows Scenario: The one where there are 2 unique fields and 1 non unique field - Given there is a field foo + Given there is a non nullable field foo And foo is unique And foo has type "integer" And foo is greater than 0 And foo is anything but null - And there is a field bar + And there is a non nullable field bar And bar has type "string" And bar is equal to "not unique" And the generation strategy is random @@ -31,7 +31,7 @@ Feature: As a user Scenario: The one where the range is exceeded Given unique is less than 3 - And there is a field foo + And there is a non nullable field foo And foo has type "integer" And foo is greater than 0 And foo is anything but null @@ -41,12 +41,12 @@ Feature: As a user | 2 | 2 | Scenario: The one where combination strategy is minimal - And there is a field foo + And there is a non nullable field foo And foo has type "integer" And foo is greater than 0 And foo is less than 4 And foo is anything but null - And there is a field bar + And there is a non nullable field bar And bar has type "integer" And bar is greater than 0 And bar is less than 4 @@ -61,12 +61,12 @@ Feature: As a user Scenario: The one where combination strategy is exhaustive Given the combination strategy is exhaustive - And there is a field foo + And there is a non nullable field foo And foo has type "integer" And foo is greater than 0 And foo is less than 4 And foo is anything but null - And there is a field bar + And there is a non nullable field bar And bar has type "integer" And bar is greater than 0 And bar is less than 4 diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature index b32218374..8da9233be 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature @@ -1,7 +1,7 @@ Feature: The violations mode of the Data Helix app can be run in violations mode to create data Background: - Given there is a field foo + Given there is a non nullable field foo And the data requested is violating And the generator can generate at most 5 rows diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature index ce4974742..c2a07fa5c 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature @@ -6,7 +6,7 @@ Feature: User can specify that a value is equalTo a required value ### alone ### Scenario: Running an 'equalTo' of a string should return only the string - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "Test String 1" Then the following data should be generated: @@ -14,7 +14,7 @@ Feature: User can specify that a value is equalTo a required value | "Test String 1" | Scenario: Running an 'equalTo' of a number should return only that number - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is equal to 0.14 Then the following data should be generated: @@ -22,7 +22,7 @@ Feature: User can specify that a value is equalTo a required value | 0.14 | Scenario: Running an 'equalTo' of a dateTime value should return only that date - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is equal to 2010-01-01T00:03:00.000Z Then the following data should be generated: @@ -31,7 +31,7 @@ Feature: User can specify that a value is equalTo a required value Scenario: Running an 'equalTo' of an empty string should return only the empty string - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "" Then the following data should be generated: @@ -39,27 +39,27 @@ Feature: User can specify that a value is equalTo a required value | "" | Scenario: Running an 'equalTo' of null should fail with an error message - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to null Then the profile is invalid because "The equalTo constraint has null value for field foo" Scenario: Running an 'equalTo' of an invalid date value should fail with an error message - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is equal to 2010-13-40T00:00:00.000Z Then the profile is invalid because "Date string '2010-13-40T00:00:00.000Z' must be in ISO-8601 format: Either yyyy-MM-ddTHH:mm:ss.SSS\[Z\] between 0001-01-01T00:00:00.000Z and 9999-12-31T23:59:59.999Z or yyyy-mm-dd between 0001-01-01 and 9999-12-31" And no data is created Scenario: Running an 'equalTo' request that includes an invalid time value should fail with an error message - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is equal to 2010-01-01T55:00:00.000Z Then the profile is invalid because "Date string '2010-01-01T55:00:00.000Z' must be in ISO-8601 format: Either yyyy-MM-ddTHH:mm:ss.SSS\[Z\] between 0001-01-01T00:00:00.000Z and 9999-12-31T23:59:59.999Z or yyyy-mm-dd between 0001-01-01 and 9999-12-31" And no data is created Scenario: Running a not 'equalTo' should allow null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is anything but equal to "not" And foo is null @@ -70,7 +70,7 @@ Feature: User can specify that a value is equalTo a required value ### EqualTo ### Scenario: Two equivalent 'equalTo' statements should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "a" And foo is equal to "a" @@ -79,7 +79,7 @@ Feature: User can specify that a value is equalTo a required value | "a" | Scenario: A not 'equalTo' statement should have no impact on an 'equalTo' statement - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "a" And foo is anything but equal to "A" @@ -88,7 +88,7 @@ Feature: User can specify that a value is equalTo a required value | "a" | Scenario: Contradictory 'equalTo' statements should emit no data - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "a" And foo is equal to "b" @@ -97,7 +97,7 @@ Feature: User can specify that a value is equalTo a required value ### InSet ### Scenario: Running an 'inSet' request alongside a non-contradicting 'equalTo' constraint should return only that value - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test 1" | @@ -109,7 +109,7 @@ Feature: User can specify that a value is equalTo a required value | "Test 1" | Scenario: Running an 'inSet' request alongside a contradicting 'equalTo' constraint should emit no data - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test 1" | @@ -121,7 +121,7 @@ Feature: User can specify that a value is equalTo a required value ### null ### Scenario: 'EqualTo' and not null should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is equal to 15 And foo is anything but null @@ -130,7 +130,7 @@ Feature: User can specify that a value is equalTo a required value | 15 | Scenario: 'EqualTo' a value and must be null should be contradictory - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "a" And foo is null @@ -139,7 +139,7 @@ Feature: User can specify that a value is equalTo a required value ### ofType ### Scenario Outline: 'EqualTo' should combine with type - Given there is a field foo + Given there is a non nullable field foo And foo is equal to And foo has type Then the following data should be generated: @@ -155,7 +155,7 @@ Feature: User can specify that a value is equalTo a required value ### constraints ### Scenario Outline: 'EqualTo' alongside a non-contradicting should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to And foo has type And foo is @@ -184,7 +184,7 @@ Feature: User can specify that a value is equalTo a required value ### Max String Length ### Scenario: 'EqualTo' request including a string of the maximum length should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "I am 1000 chars long jdny97XhjJE0ywt6mRMfYj1ECoNufcF3Dy2DStFmnLVHH5GcfLtLTXEG34LNgTxPvmAqYL6UCWiia23IqmzrooICtND1UtSbrsDOhQeVjNUjTNMsin6AO5oSOiLkpU0h4hctiKKg8IoZ05TrRyl8ZBg99S986vM737sSUxUv3yKj8lPOMH5ZjrgAn52D2LerAlBRvcQMoYP5mnuPidtCHT6RrHMJX44nHFeMJS6371dHMC9bDqjJRrMsnu1DWc7kUkttSPioKZbR1BDUn5s1WTM5brzWv9bgWvtFhjzHYdhMY0bxq1qXksGzAqaOkcbbUh6bCirz6N4nAt4I2aQccMQqCp5TjXAFGMLxbRO7uttWZI8GRWiXP2joA9aTw7K8Fk5rllWbGfgFHSlMHYmeGGRF8ig10LgkeVDdP7tVHyGr4O6nKV3TB61UJaHCRZUIoyPuce3SWeckv835iwVrKy9PIC5D42HBd3431GIyMy7sxpR4pWs7djW6UxhdnTC3q2MlX0aMXjDrLCAjybo89q7qJw4eEPfR2cwuc1xvSiC2RoVVlBprmLkKiDeCZPRZxxVn9QwzvPNnRsjx9nFenwfPIDf1C6MbQ22aYmxqcnxQky1gLLdPRWVYpgqzeztnBziahVuZZLob5EvFjgv5HmKnfg3DUrU2Em61l9nE0L6IYiz9xrZ0kmiDSB44cEOoubhJUwihD7PrM92pmCKXoWouigS6LSlCIX8OkQxaHRA0m2FYgtYV0H9rkK0kQfflvlF3zd7TvSjW1NGRxzjh5jGNfvkl9M9O5tpvieoM55uPi2fY9f8ZD2Eq0KjEHEcKtLNWnxdpuIVa7mzByWqkawwrhdjH0qF4RwXsGbTHhrNT7SFyBs4h1MdKEkUlrXgGlXXtSo104KsMv5qWIXRI221jjfwZZ7nl1XLSSOqLhDoWdvgiR0XPPwvLtPMBWiwqW86upHDMMcPAYKCnP" Then the following data should be generated: @@ -194,7 +194,7 @@ Feature: User can specify that a value is equalTo a required value ### Financial code types ### Scenario: Equal to a valid ISIN combined with an ISIN constraint should generate the equal to value - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "GB0002634946" And foo has type "ISIN" @@ -203,21 +203,21 @@ Feature: User can specify that a value is equalTo a required value | "GB0002634946" | Scenario: Equal to something that is not a valid ISIN because its check digit is wrong combined with an ISIN constraint should generate no data - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "GB00026349" And foo has type "ISIN" Then no data is created Scenario: Equal to something that is not a valid ISIN combined with an ISIN constraint should generate no data - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "aa" And foo has type "ISIN" Then no data is created Scenario: Not equal to something that is not a valid SEDOL combined with a SEDOL constraint should generate SEDOLs - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is anything but equal to "a" And foo has type "SEDOL" @@ -231,21 +231,21 @@ Feature: User can specify that a value is equalTo a required value | "0263494" | Scenario: Equal to something that is not a valid SEDOL because its check digit is wrong combined with a SEDOL constraint should generate no data - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "0263497" And foo has type "SEDOL" Then no data is created Scenario: Equal to something that is not a valid SEDOL combined with a SEDOL constraint should generate no data - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "aa" And foo has type "SEDOL" Then no data is created Scenario: Not equal to something that is not a valid CUSIP combined with a CUSIP constraint should generate valid CUSIPs - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is anything but equal to "a" And foo has type "CUSIP" @@ -259,21 +259,21 @@ Feature: User can specify that a value is equalTo a required value | "38259P508" | Scenario: Equal to something that is not a valid CUSIP because its check digit is wrong combined with a CUSIP constraint should generate no data - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "38259P502" And foo has type "CUSIP" Then no data is created Scenario: Equal to something that is not a valid CUSIP combined with a CUSIP constraint should generate no data - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "aa" And foo has type "CUSIP" Then no data is created Scenario: Equal to a valid RIC combined with an RIC constraint should generate the equal to value - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "R.IC" And foo has type "RIC" @@ -282,7 +282,7 @@ Feature: User can specify that a value is equalTo a required value | "R.IC" | Scenario: Equal to not a RIC combined with an RIC constraint should generate no data - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is equal to "NOTRIC" And foo has type "RIC" diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/FormattedAs.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/FormattedAs.feature index 16b779618..d161b22a3 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/FormattedAs.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/FormattedAs.feature @@ -2,7 +2,7 @@ Feature: User can specify that a value is so formatted Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo #commented out tests not working with big decimal values Scenario Outline: Running a valid 'formattedAs' request on numbers should be successful diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature index eebd93b3d..93a5ec5af 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature @@ -5,7 +5,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### inSet alone ### Scenario: Running an 'inSet' request that includes strings with roman alphabet lowercase chars (a-z) only should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "aaa" | @@ -17,7 +17,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "aab" | Scenario: Running an 'inSet' request that includes strings with roman alphabet uppercase chars (A-Z) only should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "CCC" | @@ -29,7 +29,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "DDD" | Scenario: Running an 'inSet' request that includes strings with roman numeric chars (0-9) only should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "012" | @@ -41,7 +41,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "345" | Scenario: Running an 'inSet' request that includes roman character strings that include profanity should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Dick Van Dyke" | @@ -54,7 +54,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o Scenario: Running an 'inSet' request that includes roman character strings that include in-use values should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "true" | @@ -76,7 +76,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "infinity" | Scenario: Running an 'inSet' request that includes roman numeric strings that include decimal numbers should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "0.1" | @@ -92,7 +92,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "0000000.345" | Scenario: Running an 'inSet' request that includes roman numeric strings that include comma separated numbers should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "55,5" | @@ -107,7 +107,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o Scenario: Running an 'inSet' request that includes roman character strings that include valid date values should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "2010-01-01T00:00:00.000" | @@ -121,7 +121,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "2011-01-01T00:00:00.000" | Scenario: 'InSet' value of an empty string "" is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "" | @@ -131,7 +131,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "" | Scenario: Running an 'inSet' request that includes a number value (not a string) should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -145,7 +145,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 99999 | Scenario: Running an 'inSet' request that includes a decimal number value should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 0.1 | @@ -159,7 +159,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 9.0000009 | Scenario: Running an 'inSet' request that includes a negative number value should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | -10 | @@ -173,7 +173,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | -9999999999 | Scenario: Running an 'inSet' request that includes the number zero should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 0 | @@ -184,7 +184,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 0 | Scenario: Running an 'inSet' request that includes a date value should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2010-01-01T00:00:00.000Z | @@ -198,7 +198,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2011-01-01T00:00:00.000Z | Scenario: Running an 'inSet' request that includes a date value (leap year) should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2020-02-29T00:00:00.000Z | @@ -212,7 +212,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2012-02-29T00:00:00.000Z | Scenario: Running an 'inSet' request that includes a date value (system epoch dates) should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 0001-01-01T00:00:01.000Z | @@ -224,7 +224,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 9999-12-31T23:59:59.999Z | Scenario: Running an 'inSet' request that includes an invalid date value should fail with an error message - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2010-13-40T00:00:00.000Z | @@ -233,7 +233,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o And no data is created Scenario: Running an 'inSet' request that includes an invalid time value should fail with an error message - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2017-12-31T40:59:59.999Z | @@ -242,7 +242,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o And no data is created Scenario: Running an 'inSet' request that includes an empty string ("") characters should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "" | @@ -252,7 +252,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "" | Scenario: Running an 'inSet' request that includes a null entry (null) characters should throw an error - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | null | @@ -261,7 +261,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o And no data is created Scenario: Running an 'inSet' request that includes multiples of the same entry should be successful. - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -276,7 +276,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### inSet ### Scenario: Running a 'inSet' request alongside a non-contradicting inSet constraint should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test 1" | @@ -292,7 +292,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Test 3" | Scenario: 'InSet' with a non-contradictory not 'inSet' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -304,7 +304,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | Scenario: Running a 'inSet' request alongside a contradicting inSet constraint should produce null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test 1" | @@ -319,7 +319,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'inSet' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -332,7 +332,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### null ### Scenario: 'InSet' with not null is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -342,7 +342,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | Scenario: Running a 'inSet' request alongside a null constraint should produce null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test 1" | @@ -356,7 +356,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### ofType ### Scenario: 'InSet' with non-contradicting 'ofType' string should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is in set: | "Test 1" | | "Test 2" | @@ -370,7 +370,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Test 3" | Scenario: 'InSet' with non-contradicting 'ofType' integer should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is in set: | 1 | And foo has type "integer" @@ -380,7 +380,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | Scenario: 'InSet' with non-contradicting 'ofType' decimal should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is in set: | 1 | And foo has type "decimal" @@ -390,7 +390,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | Scenario: 'InSet' with non-contradicting 'ofType' datetime should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is in set: | 2019-01-01T00:00:00.000Z | And foo has type "datetime" @@ -402,7 +402,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### matchingRegex ### Scenario: Running a 'inSet' request alongside a non-contradicting 'matchingRegex' constraint should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test" | @@ -416,7 +416,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "test" | Scenario: 'InSet' string value with a not 'matchingRegex' of contradictory value is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -427,7 +427,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | Scenario: Not 'inSet' string value with a 'matchingRegex' of contradictory value is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is anything but in set: | "a" | @@ -438,7 +438,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "b" | Scenario: 'InSet' alongside a contradicting 'matchingRegex' constraint should produce null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -448,7 +448,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' alongside a 'matchingRegex' constraint of contradictory length should produce null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -458,7 +458,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: Not 'inSet' alongside a matching 'matchingRegex' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is anything but in set: | "a" | @@ -470,7 +470,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### containingRegex ### Scenario: Running a 'inSet' request alongside a non-contradicting 'containingRegex' constraint should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "aa" | @@ -482,7 +482,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "aa" | Scenario: 'InSet' string value with a not 'containingRegex' of contradictory value is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -495,7 +495,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | Scenario: 'InSet' alongside a contradicting 'containingRegex' constraint should produce null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -505,7 +505,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' alongside a 'containingRegex' constraint of contradictory length should produce null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -515,7 +515,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' alongside a contradicting not 'containingRegex' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -527,7 +527,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### ofLength ### Scenario: 'InSet' with a non contradicting 'ofLength' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -538,7 +538,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | Scenario: 'InSet' with a non contradicting not 'ofLength' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -549,7 +549,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | Scenario: Not 'inSet' with a non contradicting 'ofLength' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is anything but in set: | "a" | @@ -563,7 +563,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "b" | Scenario: 'InSet' with a contradicting 'ofLength' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -573,7 +573,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'ofLength' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -585,7 +585,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### longerThan ### Scenario: 'InSet' with a non contradicting 'longerThan' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "aa" | @@ -596,7 +596,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "aa" | Scenario: 'InSet' with a non contradicting not 'longerThan' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -607,7 +607,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | Scenario: Not 'inSet' with a non contradicting 'longerThan' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is anything but in set: | "aa" | @@ -621,7 +621,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "ba" | Scenario: 'InSet' with a contradicting 'longerThan' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -631,7 +631,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'longerThan' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "aa" | @@ -643,7 +643,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### shorterThan ### Scenario: 'InSet' with a non contradicting 'shorterThan' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -654,7 +654,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | Scenario: 'InSet' with a non contradicting not 'shorterThan' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -665,7 +665,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | Scenario: Not 'inSet' with a non contradicting 'shorterThan' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is anything but in set: | "a" | @@ -679,7 +679,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "b" | Scenario: 'InSet' with a contradicting 'shorterThan' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -689,7 +689,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'shorterThan' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -701,7 +701,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### Financial data types ### Scenario: Not in set of things that are not valid ISINs combined with an ISIN constraint generates valid ISINs - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is anything but in set: | "a" | @@ -715,7 +715,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "GB00YG2XYC52" | Scenario: In set of things that are not valid ISINs combined with an ISIN constraint only generates nulls - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -725,7 +725,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: Not in set of things that are not valid SEDOLs combined with a SEDOL constraint generates valid SEDOLs - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is anything but in set: | "a" | @@ -739,7 +739,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "0263494" | Scenario: In set of things that are not valid SEDOLs combined with a SEDOL constraint only generates null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -749,7 +749,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: Not in set of things that are not valid CUSIPs combined with a CUSIP constraint generates valid CUSIPs - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is anything but in set: | "a" | @@ -763,7 +763,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "38259P508" | Scenario: In set of things that are not valid CUSIPs combined with a CUSIP constraint only generates null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -775,7 +775,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### greaterThan ### Scenario: 'InSet' with a non contradicting 'greaterThan' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 2 | @@ -786,7 +786,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | Scenario: 'InSet' with a non contradicting not 'greaterThan' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -797,7 +797,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | Scenario: Not 'inSet' with a non contradicting 'greaterThan' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is anything but in set: | 1 | @@ -811,7 +811,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | Scenario: 'InSet' with a contradicting 'greaterThan' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -821,7 +821,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'greaterThan' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1.1 | @@ -833,7 +833,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### greaterThanOrEqualTo ### Scenario: 'InSet' with a non contradicting 'greaterThanOrEqualTo' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -844,7 +844,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | Scenario: 'InSet' with a non contradicting not 'greaterThanOrEqualTo' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -855,7 +855,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | Scenario: Not 'inSet' with a non contradicting 'greaterThanOrEqualTo' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is anything but in set: | 1 | @@ -869,7 +869,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | Scenario: 'InSet' with a contradicting 'greaterThanOrEqualTo' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -879,7 +879,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'greaterThanOrEqualTo' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -891,7 +891,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### lessThan ### Scenario: 'InSet' with a non contradicting 'lessThan' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -902,7 +902,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | Scenario: 'InSet' with a non contradicting not 'lessThan' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -913,7 +913,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | Scenario: Not 'inSet' with a non contradicting 'lessThan' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is anything but in set: | 1 | @@ -928,7 +928,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | Scenario: 'InSet' with a contradicting 'lessThan' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -938,7 +938,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'lessThan' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -950,7 +950,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### lessThanOrEqualTo ### Scenario: 'InSet' with a non contradicting 'lessThanOrEqualTo' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -961,7 +961,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | Scenario: 'InSet' with a non contradicting not 'lessThanOrEqualTo' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 2 | @@ -972,7 +972,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | Scenario: Not 'inSet' with a non contradicting 'lessThanOrEqualTo' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is anything but in set: | 1 | @@ -986,7 +986,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | Scenario: 'InSet' with a contradicting 'lessThanOrEqualTo' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 2 | @@ -996,7 +996,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'lessThanOrEqualTo' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -1008,7 +1008,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### granularTo ### Scenario: 'InSet' with a non contradicting 'granularTo' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 10 | @@ -1019,7 +1019,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 10 | Scenario: Integer within an inSet and a non contradicting 'granularTo' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is granular to 1 And foo is in set: @@ -1033,7 +1033,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | Scenario: Not 'inSet' with a non contradicting 'granularTo' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is anything but in set: | 1.1 | @@ -1047,7 +1047,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | Scenario: 'InSet' with a contradicting 'granularTo' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1.1 | @@ -1059,7 +1059,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### after ### Scenario: 'InSet' with a non contradicting 'after' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.001Z | @@ -1070,7 +1070,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.001Z | Scenario: 'InSet' with a non contradicting not 'after' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1081,7 +1081,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.000Z | Scenario: Not 'inSet' with a non contradicting 'after' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is anything but in set: | 2019-01-01T00:00:00.001Z | @@ -1096,7 +1096,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.002Z | Scenario: 'InSet' with a contradicting 'after' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1106,7 +1106,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'after' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.001Z | @@ -1118,7 +1118,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### afterOrAt ### Scenario: 'InSet' with a non contradicting 'afterOrAt' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1129,7 +1129,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.000Z | Scenario: 'InSet' with a non contradicting not 'afterOrAt' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1140,7 +1140,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.000Z | Scenario: Not 'inSet' with a non contradicting 'afterOrAt' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is anything but in set: | 2019-01-01T00:00:00.000Z | @@ -1155,7 +1155,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o Scenario: 'InSet' with a contradicting 'afterOrAt' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1165,7 +1165,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'afterOrAt' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1177,7 +1177,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### before ### Scenario: 'InSet' with a non contradicting 'before' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1188,7 +1188,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.000Z | Scenario: 'InSet' with a non contradicting not 'before' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1199,7 +1199,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.000Z | Scenario: Not 'inSet' with a non contradicting 'before' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is anything but in set: | 2019-01-01T00:00:00.001Z | @@ -1214,7 +1214,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.000Z | Scenario: 'InSet' with a contradicting 'before' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1224,7 +1224,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'before' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1236,7 +1236,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### beforeOrAt ### Scenario: 'InSet' with a non contradicting 'beforeOrAt' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1247,7 +1247,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.000Z | Scenario: 'InSet' with a non contradicting not 'beforeOrAt' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.001Z | @@ -1258,7 +1258,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.001Z | Scenario: Not 'inSet' with a non contradicting 'beforeOrAt' is successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is anything but in set: | 2019-01-01T00:00:00.001Z | @@ -1274,7 +1274,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.002Z | Scenario: 'InSet' with a contradicting 'beforeOrAt' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.001Z | @@ -1284,7 +1284,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'beforeOrAt' emits null - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1294,7 +1294,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: Running a 'inSet' request alongside an ofType = string should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test 1" | @@ -1310,7 +1310,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o Scenario: Running a 'inSet' request alongside an ofType = integer should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "integer" And foo is in set: | 1 | @@ -1325,7 +1325,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 3 | Scenario: Running a 'inSet' request alongside an ofType = decimal should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -1340,7 +1340,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 3 | Scenario: Running a 'inSet' request alongside an ofType = datetime should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "datetime" And foo is in set: | 2010-01-01T00:00:00.000Z | @@ -1355,7 +1355,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2011-01-01T00:00:00.000Z | Scenario: Running a 'inSet' request alongside a non-contradicting matchingRegex constraint should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test" | @@ -1369,7 +1369,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "test" | Scenario: Running a 'inSet' request alongside a contradicting matchingRegex constraint should produce null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test" | @@ -1382,7 +1382,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o Scenario: Running a 'inSet' request alongside a non-contradicting containingRegex constraint should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test" | @@ -1397,7 +1397,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Testt" | Scenario: Running a 'inSet' request alongside a contradicting containingRegex constraint should generate null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test" | @@ -1410,7 +1410,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: Running a 'inSet' request alongside a non-contradicting ofLength constraint should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test" | @@ -1425,7 +1425,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "test" | Scenario: Running a 'inSet' request alongside a contradicting ofLength (too short) constraint should produce null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test" | @@ -1438,7 +1438,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: Running a 'inSet' request alongside a contradicting ofLength (too long) constraint should produce null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is in set: | "Test" | @@ -1451,7 +1451,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: Running a 'inSet' request as part of a non-contradicting anyOf constraint should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is anything but null And Any Of the next 2 constraints @@ -1469,7 +1469,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Test 4" | Scenario: Running a 'inSet' request as part of a non-contradicting allOf constraint should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And All Of the next 2 constraints And foo is in set: @@ -1485,7 +1485,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Test2" | Scenario: Running a 'inSet' request as part of a contradicting allOf constraint should produce null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And All Of the next 2 constraints And foo is in set: @@ -1526,7 +1526,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Test4" | 2 | #TODO Scenario: Running a 'inSet' request alongside a contradicting ofType = string should produce null -# Given there is a field foo +# Given there is a non nullable field foo # And foo has type "string" # And foo is in set: # | 1 | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature index e07dccefd..0defe4d78 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature @@ -2,7 +2,7 @@ Feature: User can specify that a field is null or absent Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo ### alone ### diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfType.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfType.feature index d102b1221..dc8d76e2b 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfType.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfType.feature @@ -4,14 +4,14 @@ Feature: User can specify that a field is of a specific type (string, integer, d Given the generation strategy is full Scenario: Running an 'ofType' = integer request that includes a number value (not a string) should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to 1 And foo has type "integer" Then the following data should be generated: | foo | | 1 | Scenario: Running an 'ofType' = integer request that includes a number value (as a string) should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to "1" And foo has type "integer" Then the following data should be generated: @@ -19,7 +19,7 @@ Feature: User can specify that a field is of a specific type (string, integer, d | 1 | Scenario: Running an 'ofType' = decimal request that includes a decimal number value should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to 0.66 And foo has type "decimal" Then the following data should be generated: @@ -27,7 +27,7 @@ Feature: User can specify that a field is of a specific type (string, integer, d | 0.66 | Scenario: Running an 'ofType' = decimal request that includes a negative number value should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to -99.4 And foo has type "decimal" Then the following data should be generated: @@ -35,7 +35,7 @@ Feature: User can specify that a field is of a specific type (string, integer, d | -99.4 | Scenario: Running an 'ofType' = integer request that includes a negative number value should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to -99 And foo has type "integer" Then the following data should be generated: @@ -43,7 +43,7 @@ Feature: User can specify that a field is of a specific type (string, integer, d | -99 | Scenario: Running an 'ofType' = integer request that includes the number zero should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to 0 And foo has type "integer" Then the following data should be generated: @@ -51,7 +51,7 @@ Feature: User can specify that a field is of a specific type (string, integer, d | 0 | Scenario: Running an 'ofType' = decimal request that includes the number zero should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to 0 And foo has type "decimal" Then the following data should be generated: @@ -59,7 +59,7 @@ Feature: User can specify that a field is of a specific type (string, integer, d | 0 | Scenario: Running an 'ofType' = datetime request that includes a date value (not a string) should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to 2010-01-01T00:00:00.000Z And foo has type "datetime" Then the following data should be generated: @@ -67,7 +67,7 @@ Feature: User can specify that a field is of a specific type (string, integer, d | 2010-01-01T00:00:00.000Z | Scenario: Running an 'ofType' = datetime request that includes a date value (leap year) should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to 2020-02-29T09:15:00.000Z And foo has type "datetime" Then the following data should be generated: @@ -75,7 +75,7 @@ Feature: User can specify that a field is of a specific type (string, integer, d | 2020-02-29T09:15:00.000Z | Scenario: Running an 'ofType' = datetime request that includes a date value (system max future dates) should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to 9999-12-31T23:59:59.999Z And foo has type "datetime" Then the following data should be generated: @@ -83,21 +83,21 @@ Feature: User can specify that a field is of a specific type (string, integer, d | 9999-12-31T23:59:59.999Z | Scenario: Running an 'ofType' = datetime request that includes an invalid date value should fail with an error message - Given there is a field foo + Given there is a non nullable field foo And foo is equal to 2010-13-40T00:00:00.000Z And foo has type "datetime" Then the profile is invalid because "Date string '2010-13-40T00:00:00.000Z' must be in ISO-8601 format: Either yyyy-MM-ddTHH:mm:ss.SSS\[Z\] between 0001-01-01T00:00:00.000Z and 9999-12-31T23:59:59.999Z or yyyy-mm-dd between 0001-01-01 and 9999-12-31" And no data is created Scenario: Running an 'ofType' = datetime request that includes an invalid time value should fail with an error message - Given there is a field foo + Given there is a non nullable field foo And foo is equal to 2010-01-01T75:00:00.000Z And foo has type "datetime" Then the profile is invalid because "Date string '2010-01-01T75:00:00.000Z' must be in ISO-8601 format: Either yyyy-MM-ddTHH:mm:ss.SSS\[Z\] between 0001-01-01T00:00:00.000Z and 9999-12-31T23:59:59.999Z or yyyy-mm-dd between 0001-01-01 and 9999-12-31" And no data is created Scenario: Running an 'ofType' = date request should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to 2010-01-01 And foo has type "date" Then the following data should be generated: @@ -106,7 +106,7 @@ Feature: User can specify that a field is of a specific type (string, integer, d @ignore #pending development of 1381 - Add date time and fields Scenario: Running an 'ofType' = time request should be successful - Given there is a field foo + Given there is a non nullable field foo And foo is equal to T09:15:00.000Z And foo has type "time" Then the following data should be generated: @@ -114,7 +114,7 @@ Feature: User can specify that a field is of a specific type (string, integer, d | T09:15:00.000Z | Scenario: Running an 'ofType' = string request without other constraints should generate strings up to implicit maximum length - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And the generation strategy is random And the generator can generate at most 20 rows diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature index 0c7b76e4c..9d9d3f4a0 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature @@ -2,7 +2,7 @@ Feature: User can specify that a field must be a financial code type Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo Scenario: An ofType constraint with the value "ISIN" generates valid ISINs Given foo has type "ISIN" diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeNames.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeNames.feature index 6caa3503d..9f79c2b54 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeNames.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeNames.feature @@ -2,7 +2,7 @@ Feature: User can specify that a field must be a type of name Background: Given the generation strategy is random - And there is a field foo + And there is a non nullable field foo And foo has type "string" And foo is anything but null diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AllOf.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AllOf.feature index c5124e57e..61adfc1ca 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AllOf.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AllOf.feature @@ -4,7 +4,7 @@ Feature: User can specify that data must be created to conform to each of multip Given the generation strategy is full Scenario: Running an 'allOf' request that contains a valid nested allOf request should be successful - Given there is a field foo + Given there is a non nullable field foo And All Of the next 2 constraints And All Of the next 2 constraints And foo is matching regex /[a-b]{2}/ @@ -20,7 +20,7 @@ Feature: User can specify that data must be created to conform to each of multip | null | Scenario: Running an 'allOf' request that contains an invalid nested allOf request should generate null - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And All Of the next 2 constraints And All Of the next 2 constraints @@ -32,7 +32,7 @@ Feature: User can specify that data must be created to conform to each of multip | null | Scenario: Running a 'allOf' request that includes multiple values within the same statement should be successful - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And All Of the next 2 constraints And foo is equal to "Test01" @@ -42,7 +42,7 @@ Feature: User can specify that data must be created to conform to each of multip | "Test01" | Scenario: User attempts to combine two constraints that only intersect at the empty set within an allOf operator should not generate data - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And All Of the next 2 constraints And foo is equal to "Test01" diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AnyOf.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AnyOf.feature index dab9074dc..5543a8dea 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AnyOf.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AnyOf.feature @@ -2,7 +2,7 @@ Feature: Values can be specified by using any of to set multiple constraints Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo Scenario: User requires to create a field with strings that conform to one or many constraints Given Any Of the next 3 constraints diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature index f37be774f..b3e3c50c5 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature @@ -5,11 +5,11 @@ Feature:As a User Background: Given the generation strategy is full And the combination strategy is exhaustive - And there is a field foo + And there is a non nullable field foo And foo has type "integer" And foo is greater than 0 And foo is anything but null - And there is a field bar + And there is a non nullable field bar And bar has type "integer" And bar is anything but null diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GranularTo-Decimal.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GranularTo-Decimal.feature index b605040d7..697416174 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GranularTo-Decimal.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GranularTo-Decimal.feature @@ -2,7 +2,7 @@ Feature: User can specify that decimal fields are granular to a certain number o Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo is anything but null And foo has type "decimal" @@ -76,7 +76,7 @@ Feature: User can specify that decimal fields are granular to a certain number o And foo is greater than or equal to 1 And foo is anything but null And bar is anything but null - And there is a field bar + And there is a non nullable field bar And bar has type "decimal" And bar is granular to 0.1 And bar is less than 1.4 diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature index b689a5383..88b0c595a 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature @@ -2,7 +2,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo ###Integer diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature index 0f7ff665a..2619a40c8 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature @@ -2,7 +2,7 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo Scenario: Running a 'greaterThanOrEqualTo' request that includes a positive integer should be successful Given foo is greater than or equal to 0 diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature index c63928edd..d3c9cb102 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature @@ -2,7 +2,7 @@ Feature: User can specify that a numeric value is lower than, but not equal to, Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "decimal" Scenario: lessThan run against a non contradicting not lessThan should be successful (lessThan 5 AND not lessThan 1) diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature index f3f727c0c..e9d1831ab 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature @@ -2,7 +2,7 @@ Feature: User can specify that a numeric value is lower than, or equal to, a spe Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo Scenario: lessThanOrEqualTo run against a non contradicting not lessThanOrEqualToOrEqualTo should be successful Given foo is less than or equal to 5 diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/CharacterSet.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/CharacterSet.feature index f2bd8f95a..401095394 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/CharacterSet.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/CharacterSet.feature @@ -2,7 +2,7 @@ Feature: Strings will be generated using characters from only latin characters Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "string" Scenario: Running a 'matchingRegex' request that includes roman alphabet lowercase chars (a-z) only should be successful diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ContainingRegex.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ContainingRegex.feature index 57bb72751..8c6d36c39 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ContainingRegex.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ContainingRegex.feature @@ -2,7 +2,7 @@ Feature: User can specify that contains a specified regex Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "string" Scenario: Running a 'containingRegex' request that includes roman alphabet lowercase chars (a-z) only should be successful diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature index 1452f2a87..7b4640ae7 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature @@ -2,7 +2,7 @@ Feature: User can specify that a string length is longer than, a specified numbe Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "string" Scenario: Running a 'longerThan' request that includes positive value should be successful diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex-SpecialChars.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex-SpecialChars.feature index 5a84df326..b769cf0ea 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex-SpecialChars.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex-SpecialChars.feature @@ -3,7 +3,7 @@ Feature: Whilst including non-latin characters, user can specify that a value ei Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "string" Scenario: Running a 'matchingRegex' request that includes special characters (emoji) only should be successful diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature index 985fceb00..f52d12551 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature @@ -2,7 +2,7 @@ Feature: User can specify that a value either matches or contains a specified re Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "string" Scenario: Running a 'matchingRegex' request that includes roman alphabet lowercase chars (a-z) only should be successful @@ -205,7 +205,7 @@ Feature: User can specify that a value either matches or contains a specified re And no data is created Scenario: Running a 'matchingRegex' request with the value property set to a null entry (null) should throw an error - Given there is a field foo + Given there is a non nullable field foo And foo has type "string" And foo is matching regex null Then the profile is invalid because "The matchingRegex constraint has null value for field foo" @@ -426,13 +426,13 @@ Feature: User can specify that a value either matches or contains a specified re | null | Scenario: Running a 'matchingRegex' and 'inSet' and 'integer' request nulls are generated last - Given there is a field bar + Given there is a non nullable field bar And bar has type "string" And the combination strategy is exhaustive And foo is matching regex /[a]{1}/ And bar is in set: | "AA" | - And there is a field lee + And there is a non nullable field lee And lee has type "integer" And lee is granular to 1 And lee is less than 2 diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature index 9ea6749ce..3adc435c9 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature @@ -2,7 +2,7 @@ Feature: User can specify the length of generated string data using 'ofLength' Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "string" Scenario Outline: Running an 'ofLength' request on a roman alphabet character string should be successful diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature index 03508c5e0..48c68c157 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature @@ -2,7 +2,7 @@ Feature: User can specify that a string length is lower than, a specified number Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "string" Scenario: Running a 'shorterThan' request using a number to specify a the length of a generated string should be successful diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/After.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/After.feature index 17b1547f5..eda5edb8a 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/After.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/After.feature @@ -2,7 +2,7 @@ Feature: User can specify that a datetime date is after, but not equal to, a spe Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "datetime" Scenario: 'After' valid date is successful for a single row diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/AfterOrAt.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/AfterOrAt.feature index fe8ae6a89..1302e25db 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/AfterOrAt.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/AfterOrAt.feature @@ -2,7 +2,7 @@ Feature: User can specify that a datetime date is more than, or the same as, a s Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "datetime" And foo is anything but null diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/Before.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/Before.feature index ced598a90..a4f5bb266 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/Before.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/Before.feature @@ -2,7 +2,7 @@ Feature: User can specify that a datetime date is lower than, but not equal to, Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "datetime" #Alone diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/BeforeOrAt.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/BeforeOrAt.feature index 3c0b1070f..9835143dd 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/BeforeOrAt.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/BeforeOrAt.feature @@ -2,7 +2,7 @@ Feature: User can specify that a datetime date is lower than, or the same as, a Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "datetime" And foo is anything but null diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField-Multiple.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField-Multiple.feature index 5aa4746bd..1ccdddbe9 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField-Multiple.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField-Multiple.feature @@ -2,11 +2,11 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Background: Given the generation strategy is full - And there is a field foobar + And there is a non nullable field foobar And foobar has type "datetime" - And there is a field foo + And there is a non nullable field foo And foo has type "datetime" - And there is a field bar + And there is a non nullable field bar And bar has type "datetime" And the combination strategy is exhaustive diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField.feature index aacd8edd3..78c478a45 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField.feature @@ -2,10 +2,10 @@ Feature: running datetimes related to otherfield datetimes Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "datetime" And foo is anything but null - And there is a field bar + And there is a non nullable field bar And bar has type "datetime" And bar is anything but null And the combination strategy is exhaustive diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/GranularTo-DateTime.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/GranularTo-DateTime.feature index 3e751920e..771b1c9e2 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/GranularTo-DateTime.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/GranularTo-DateTime.feature @@ -2,7 +2,7 @@ Feature: User can specify that datetime fields are granular to a certain unit Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo is anything but null And foo has type "datetime" diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Decimal.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Decimal.feature index bdb8ded23..7415d9a13 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Decimal.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Decimal.feature @@ -2,7 +2,7 @@ Feature: User can specify that a number has type decimal and can have varying nu Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "decimal" And foo is anything but null diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Integer.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Integer.feature index baaa8cdaa..fe2536394 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Integer.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Integer.feature @@ -2,7 +2,7 @@ Feature: User can specify that a number has type integer and does not have any d Background: Given the generation strategy is full - And there is a field foo + And there is a non nullable field foo And foo has type "integer" And foo is anything but null diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/validation/TypeMandation.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/validation/TypeMandation.feature index cfc9f3c22..7156b2756 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/validation/TypeMandation.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/validation/TypeMandation.feature @@ -2,18 +2,18 @@ Feature: Type mandation validation Profiles should be rejected if they don't positively specify (to a certain standard) the types of all their fields. Scenario: An explicit type constraint should satisfy type mandation - Given there is a field user_id + Given there is a non nullable field user_id And user_id has type "string" Then the profile should be considered valid Scenario: An equalTo constraint should satisfy type mandation - Given there is a field user_id + Given there is a non nullable field user_id And user_id is equal to "banana" And user_id has type "string" Then the profile should be considered valid Scenario: An inSet constraint should satisfy type mandation - Given there is a field user_id + Given there is a non nullable field user_id And user_id has type "string" And user_id is in set: | "banana" | @@ -21,16 +21,16 @@ Feature: Type mandation validation Then the profile should be considered valid Scenario: An ISIN constraint should satisfy type mandation - Given there is a field foo + Given there is a non nullable field foo And foo has type "ISIN" Then the profile should be considered valid Scenario: A SEDOL constraint should satisfy type mandation - Given there is a field foo + Given there is a non nullable field foo And foo has type "SEDOL" Then the profile should be considered valid Scenario: A CUSIP constraint should satisfy type mandation - Given there is a field foo + Given there is a non nullable field foo And foo has type "CUSIP" Then the profile should be considered valid diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/GeneralTestStep.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/GeneralTestStep.java index 046d643af..1c42ab4f6 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/GeneralTestStep.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/GeneralTestStep.java @@ -49,14 +49,19 @@ public void BeforeEach() { this.cucumberTestHelper = new CucumberTestHelper(state); } - @Given("there is a field (.+)$") - public void thereIsAField(String fieldName) { - this.state.addField(fieldName); + @Given("there is a nullable field (.+)$") + public void thereIsANullableField(String fieldName) { + this.state.addNullableField(fieldName); + } + + @Given("there is a non nullable field (.+)$") + public void thereIsANonNullableField(String fieldName) { + this.state.addNonNullableField(fieldName); } @Given("^the following fields exist:$") public void thereAreFields(List fields) { - fields.forEach(this::thereIsAField); + fields.forEach(this::thereIsANonNullableField); } @When("the generation strategy is {generationStrategy}") diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberTestState.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberTestState.java index 1d2e2e178..a90a48f3d 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberTestState.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberTestState.java @@ -102,12 +102,19 @@ public List getValuesFromMap(String name, String key) { } - public void addField(String fieldName) { + public void addNonNullableField(String fieldName) { FieldDTO fieldDTO = new FieldDTO(); fieldDTO.name = fieldName; this.profileFields.add(fieldDTO); } + public void addNullableField(String fieldName) { + FieldDTO fieldDTO = new FieldDTO(); + fieldDTO.name = fieldName; + fieldDTO.nullable = true; + this.profileFields.add(fieldDTO); + } + public void addException(Exception e){ this.testExceptions.add(e); } From 2b4cfdf84ed1308222835b965b02e33856a0f88b Mon Sep 17 00:00:00 2001 From: JHarrisSL Date: Mon, 21 Oct 2019 13:10:07 +0100 Subject: [PATCH 04/10] Update cucumber tests to use new non-null by default behaviour of FieldDTO --- .../cucumber/features/Random.feature | 2 +- .../cucumber/features/Violation.feature | 2 +- .../operators/general/EqualTo.feature | 4 +- .../features/operators/general/InSet.feature | 165 +++++------------- .../features/operators/general/Null.feature | 2 +- .../general/OfTypeFinancialCodes.feature | 6 - .../operators/grammatical/AllOf.feature | 2 - 7 files changed, 50 insertions(+), 133 deletions(-) diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature index 0276288e5..4d83bbbc7 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature @@ -2,7 +2,7 @@ Feature: User can generate valid data for all types (string, integer, decimal, o Background: Given the generation strategy is random - And there is a non nullable field foo + And there is a nullable field foo Scenario: The generator produces valid 'DateTime' data in random mode Given foo has type "datetime" diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature index 8da9233be..1689f5cb7 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature @@ -1,7 +1,7 @@ Feature: The violations mode of the Data Helix app can be run in violations mode to create data Background: - Given there is a non nullable field foo + Given there is a nullable field foo And the data requested is violating And the generator can generate at most 5 rows diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature index c2a07fa5c..707def05c 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature @@ -59,7 +59,7 @@ Feature: User can specify that a value is equalTo a required value And no data is created Scenario: Running a not 'equalTo' should allow null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is anything but equal to "not" And foo is null @@ -227,7 +227,6 @@ Feature: User can specify that a value is equalTo a required value | "0263497" | Then the following data should be generated: | foo | - | null | | "0263494" | Scenario: Equal to something that is not a valid SEDOL because its check digit is wrong combined with a SEDOL constraint should generate no data @@ -255,7 +254,6 @@ Feature: User can specify that a value is equalTo a required value | "38259P502" | Then the following data should be generated: | foo | - | null | | "38259P508" | Scenario: Equal to something that is not a valid CUSIP because its check digit is wrong combined with a CUSIP constraint should generate no data diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature index 93a5ec5af..546b0ea04 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature @@ -12,7 +12,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "aab" | Then the following data should be generated: | foo | - | null | | "aaa" | | "aab" | @@ -24,7 +23,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "DDD" | Then the following data should be generated: | foo | - | null | | "CCC" | | "DDD" | @@ -36,7 +34,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "345" | Then the following data should be generated: | foo | - | null | | "012" | | "345" | @@ -48,13 +45,12 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Scunthorpe Hospital" | Then the following data should be generated: | foo | - | null | | "Dick Van Dyke" | | "Scunthorpe Hospital" | Scenario: Running an 'inSet' request that includes roman character strings that include in-use values should be successful - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "true" | @@ -85,7 +81,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "0000000.345" | Then the following data should be generated: | foo | - | null | | "0.1" | | "0.00" | | "12.5.99" | @@ -100,7 +95,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "1,000,000.00" | Then the following data should be generated: | foo | - | null | | "55,5" | | "10,000" | | "1,000,000.00" | @@ -115,13 +109,12 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "2011-01-01T00:00:00.000" | Then the following data should be generated: | foo | - | null | | "2010-01-01T00:00:00.000" | | "2010-01-01T00:00:00.001" | | "2011-01-01T00:00:00.000" | Scenario: 'InSet' value of an empty string "" is successful - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "" | @@ -139,7 +132,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 99999 | Then the following data should be generated: | foo | - | null | | 1 | | 54 | | 99999 | @@ -153,7 +145,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 9.0000009 | Then the following data should be generated: | foo | - | null | | 0.1 | | 600.01 | | 9.0000009 | @@ -167,7 +158,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | -9999999999 | Then the following data should be generated: | foo | - | null | | -10 | | -0.0000089 | | -9999999999 | @@ -180,7 +170,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 0.0 | Then the following data should be generated: | foo | - | null | | 0 | Scenario: Running an 'inSet' request that includes a date value should be successful @@ -192,7 +181,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2011-01-01T00:00:00.000Z | Then the following data should be generated: | foo | - | null | | 2010-01-01T00:00:00.000Z | | 2010-01-01T00:00:00.001Z | | 2011-01-01T00:00:00.000Z | @@ -206,7 +194,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2012-02-29T00:00:00.000Z | Then the following data should be generated: | foo | - | null | | 2020-02-29T00:00:00.000Z | | 2016-02-29T00:00:00.000Z | | 2012-02-29T00:00:00.000Z | @@ -219,7 +206,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 9999-12-31T23:59:59.999Z | Then the following data should be generated: | foo | - | null | | 0001-01-01T00:00:01.000Z | | 9999-12-31T23:59:59.999Z | @@ -242,7 +228,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o And no data is created Scenario: Running an 'inSet' request that includes an empty string ("") characters should be successful - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "" | @@ -252,7 +238,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "" | Scenario: Running an 'inSet' request that includes a null entry (null) characters should throw an error - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "decimal" And foo is in set: | null | @@ -269,7 +255,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | Then the following data should be generated: | foo | - | null | | 1 | | 2 | @@ -288,7 +273,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Test 5" | Then the following data should be generated: | foo | - | null | | "Test 3" | Scenario: 'InSet' with a non-contradictory not 'inSet' is successful @@ -300,11 +284,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "A" | Then the following data should be generated: | foo | - | null | | "a" | Scenario: Running a 'inSet' request alongside a contradicting inSet constraint should produce null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "Test 1" | @@ -319,7 +302,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'inSet' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -332,7 +315,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### null ### Scenario: 'InSet' with not null is successful - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -342,7 +325,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | Scenario: Running a 'inSet' request alongside a null constraint should produce null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "Test 1" | @@ -364,7 +347,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo has type "string" Then the following data should be generated: | foo | - | null | | "Test 1" | | "Test 2" | | "Test 3" | @@ -376,7 +358,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo has type "integer" Then the following data should be generated: | foo | - | null | | 1 | Scenario: 'InSet' with non-contradicting 'ofType' decimal should be successful @@ -386,7 +367,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo has type "decimal" Then the following data should be generated: | foo | - | null | | 1 | Scenario: 'InSet' with non-contradicting 'ofType' datetime should be successful @@ -396,7 +376,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo has type "datetime" Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.000Z | ### matchingRegex ### @@ -412,7 +391,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is matching regex /[a-z]{4}/ Then the following data should be generated: | foo | - | null | | "test" | Scenario: 'InSet' string value with a not 'matchingRegex' of contradictory value is successful @@ -423,7 +401,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but matching regex /[b]{1}/ Then the following data should be generated: | foo | - | null | | "a" | Scenario: Not 'inSet' string value with a 'matchingRegex' of contradictory value is successful @@ -434,11 +411,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is matching regex /[b]{1}/ Then the following data should be generated: | foo | - | null | | "b" | Scenario: 'InSet' alongside a contradicting 'matchingRegex' constraint should produce null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -448,7 +424,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' alongside a 'matchingRegex' constraint of contradictory length should produce null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -458,7 +434,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: Not 'inSet' alongside a matching 'matchingRegex' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is anything but in set: | "a" | @@ -478,7 +454,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is containing regex /[a]{1}/ Then the following data should be generated: | foo | - | null | | "aa" | Scenario: 'InSet' string value with a not 'containingRegex' of contradictory value is successful @@ -491,11 +466,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but containing regex /[b]{1}/ Then the following data should be generated: | foo | - | null | | "a" | Scenario: 'InSet' alongside a contradicting 'containingRegex' constraint should produce null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -505,7 +479,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' alongside a 'containingRegex' constraint of contradictory length should produce null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -515,7 +489,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' alongside a contradicting not 'containingRegex' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -534,7 +508,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is of length 1 Then the following data should be generated: | foo | - | null | | "a" | Scenario: 'InSet' with a non contradicting not 'ofLength' is successful @@ -545,7 +518,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but of length 2 Then the following data should be generated: | foo | - | null | | "a" | Scenario: Not 'inSet' with a non contradicting 'ofLength' is successful @@ -559,11 +531,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "b" | Then the following data should be generated: | foo | - | null | | "b" | Scenario: 'InSet' with a contradicting 'ofLength' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -573,7 +544,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'ofLength' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -592,7 +563,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is longer than 1 Then the following data should be generated: | foo | - | null | | "aa" | Scenario: 'InSet' with a non contradicting not 'longerThan' is successful @@ -603,7 +573,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but longer than 1 Then the following data should be generated: | foo | - | null | | "a" | Scenario: Not 'inSet' with a non contradicting 'longerThan' is successful @@ -617,11 +586,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "ba" | Then the following data should be generated: | foo | - | null | | "ba" | Scenario: 'InSet' with a contradicting 'longerThan' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -631,7 +599,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'longerThan' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "aa" | @@ -650,7 +618,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is shorter than 2 Then the following data should be generated: | foo | - | null | | "a" | Scenario: 'InSet' with a non contradicting not 'shorterThan' is successful @@ -661,7 +628,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but shorter than 1 Then the following data should be generated: | foo | - | null | | "a" | Scenario: Not 'inSet' with a non contradicting 'shorterThan' is successful @@ -675,11 +641,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "b" | Then the following data should be generated: | foo | - | null | | "b" | Scenario: 'InSet' with a contradicting 'shorterThan' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -689,7 +654,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'shorterThan' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -711,11 +676,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "GB00YG2XYC52" | Then the following data should be generated: | foo | - | null | | "GB00YG2XYC52" | Scenario: In set of things that are not valid ISINs combined with an ISIN constraint only generates nulls - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -735,11 +699,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "0263494" | Then the following data should be generated: | foo | - | null | | "0263494" | Scenario: In set of things that are not valid SEDOLs combined with a SEDOL constraint only generates null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -759,11 +722,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "38259P508" | Then the following data should be generated: | foo | - | null | | "38259P508" | Scenario: In set of things that are not valid CUSIPs combined with a CUSIP constraint only generates null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "a" | @@ -782,7 +744,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is greater than 1 Then the following data should be generated: | foo | - | null | | 2 | Scenario: 'InSet' with a non contradicting not 'greaterThan' is successful @@ -793,7 +754,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but greater than 1 Then the following data should be generated: | foo | - | null | | 1 | Scenario: Not 'inSet' with a non contradicting 'greaterThan' is successful @@ -807,11 +767,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | Then the following data should be generated: | foo | - | null | | 2 | Scenario: 'InSet' with a contradicting 'greaterThan' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -821,7 +780,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'greaterThan' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "decimal" And foo is in set: | 1.1 | @@ -840,7 +799,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is greater than or equal to 1 Then the following data should be generated: | foo | - | null | | 1 | Scenario: 'InSet' with a non contradicting not 'greaterThanOrEqualTo' is successful @@ -851,7 +809,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but greater than or equal to 2 Then the following data should be generated: | foo | - | null | | 1 | Scenario: Not 'inSet' with a non contradicting 'greaterThanOrEqualTo' is successful @@ -865,11 +822,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | Then the following data should be generated: | foo | - | null | | 2 | Scenario: 'InSet' with a contradicting 'greaterThanOrEqualTo' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -879,7 +835,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'greaterThanOrEqualTo' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -898,7 +854,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is less than 2 Then the following data should be generated: | foo | - | null | | 1 | Scenario: 'InSet' with a non contradicting not 'lessThan' is successful @@ -909,7 +864,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but less than 1 Then the following data should be generated: | foo | - | null | | 1 | Scenario: Not 'inSet' with a non contradicting 'lessThan' is successful @@ -924,11 +878,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 3 | Then the following data should be generated: | foo | - | null | | 2 | Scenario: 'InSet' with a contradicting 'lessThan' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -938,7 +891,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'lessThan' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -957,7 +910,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is less than or equal to 1 Then the following data should be generated: | foo | - | null | | 1 | Scenario: 'InSet' with a non contradicting not 'lessThanOrEqualTo' is successful @@ -968,7 +920,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but less than or equal to 1 Then the following data should be generated: | foo | - | null | | 2 | Scenario: Not 'inSet' with a non contradicting 'lessThanOrEqualTo' is successful @@ -982,11 +933,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | Then the following data should be generated: | foo | - | null | | 2 | Scenario: 'InSet' with a contradicting 'lessThanOrEqualTo' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "decimal" And foo is in set: | 2 | @@ -996,7 +946,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'lessThanOrEqualTo' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "decimal" And foo is in set: | 1 | @@ -1015,7 +965,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is granular to 1 Then the following data should be generated: | foo | - | null | | 10 | Scenario: Integer within an inSet and a non contradicting 'granularTo' is successful @@ -1028,7 +977,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2.0 | Then the following data should be generated: | foo | - | null | | 1 | | 2 | @@ -1043,11 +991,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | Then the following data should be generated: | foo | - | null | | 1 | Scenario: 'InSet' with a contradicting 'granularTo' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "decimal" And foo is in set: | 1.1 | @@ -1066,7 +1013,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is after 2019-01-01T00:00:00.000Z Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.001Z | Scenario: 'InSet' with a non contradicting not 'after' is successful @@ -1077,7 +1023,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but after 2019-01-01T00:00:00.000Z Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.000Z | Scenario: Not 'inSet' with a non contradicting 'after' is successful @@ -1092,11 +1037,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.002Z | Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.002Z | Scenario: 'InSet' with a contradicting 'after' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1106,7 +1050,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'after' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.001Z | @@ -1125,7 +1069,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is after or at 2019-01-01T00:00:00.000Z Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.000Z | Scenario: 'InSet' with a non contradicting not 'afterOrAt' is successful @@ -1136,7 +1079,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but after or at 2019-01-01T00:00:00.001Z Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.000Z | Scenario: Not 'inSet' with a non contradicting 'afterOrAt' is successful @@ -1150,12 +1092,11 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.001Z | Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.001Z | Scenario: 'InSet' with a contradicting 'afterOrAt' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1165,7 +1106,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'afterOrAt' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1184,7 +1125,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is before 2019-01-01T00:00:00.001Z Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.000Z | Scenario: 'InSet' with a non contradicting not 'before' is successful @@ -1195,7 +1135,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but before 2019-01-01T00:00:00.000Z Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.000Z | Scenario: Not 'inSet' with a non contradicting 'before' is successful @@ -1210,11 +1149,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.002Z | Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.000Z | Scenario: 'InSet' with a contradicting 'before' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1224,7 +1162,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'before' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1243,7 +1181,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is before or at 2019-01-01T00:00:00.000Z Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.000Z | Scenario: 'InSet' with a non contradicting not 'beforeOrAt' is successful @@ -1254,7 +1191,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but before or at 2019-01-01T00:00:00.000Z Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.001Z | Scenario: Not 'inSet' with a non contradicting 'beforeOrAt' is successful @@ -1269,12 +1205,11 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.002Z | Then the following data should be generated: | foo | - | null | | 2019-01-01T00:00:00.000Z | | 2019-01-01T00:00:00.002Z | Scenario: 'InSet' with a contradicting 'beforeOrAt' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.001Z | @@ -1284,7 +1219,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: 'InSet' with a contradicting not 'beforeOrAt' emits null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "datetime" And foo is in set: | 2019-01-01T00:00:00.000Z | @@ -1303,7 +1238,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo has type "string" Then the following data should be generated: | foo | - | null | | "Test 1" | | "Test 2" | | "Test 3" | @@ -1319,7 +1253,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo has type "integer" Then the following data should be generated: | foo | - | null | | 1 | | 2 | | 3 | @@ -1334,7 +1267,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo has type "decimal" Then the following data should be generated: | foo | - | null | | 1 | | 2 | | 3 | @@ -1349,7 +1281,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo has type "datetime" Then the following data should be generated: | foo | - | null | | 2010-01-01T00:00:00.000Z | | 2010-01-01T00:00:00.001Z | | 2011-01-01T00:00:00.000Z | @@ -1365,11 +1296,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is matching regex /[a-z]{4}/ Then the following data should be generated: | foo | - | null | | "test" | Scenario: Running a 'inSet' request alongside a contradicting matchingRegex constraint should produce null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "Test" | @@ -1392,12 +1322,11 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is containing regex /[a-z]{4}/ Then the following data should be generated: | foo | - | null | | "test" | | "Testt" | Scenario: Running a 'inSet' request alongside a contradicting containingRegex constraint should generate null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "Test" | @@ -1420,12 +1349,11 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is of length 4 Then the following data should be generated: | foo | - | null | | "Test" | | "test" | Scenario: Running a 'inSet' request alongside a contradicting ofLength (too short) constraint should produce null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "Test" | @@ -1438,7 +1366,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: Running a 'inSet' request alongside a contradicting ofLength (too long) constraint should produce null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is in set: | "Test" | @@ -1451,7 +1379,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | Scenario: Running a 'inSet' request as part of a non-contradicting anyOf constraint should be successful - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And foo is anything but null And Any Of the next 2 constraints @@ -1480,12 +1408,11 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Test2" | Then the following data should be generated: | foo | - | null | | "Test1" | | "Test2" | Scenario: Running a 'inSet' request as part of a contradicting allOf constraint should produce null - Given there is a non nullable field foo + Given there is a nullable field foo And foo has type "string" And All Of the next 2 constraints And foo is in set: diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature index 0defe4d78..8caaf08f7 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature @@ -2,7 +2,7 @@ Feature: User can specify that a field is null or absent Background: Given the generation strategy is full - And there is a non nullable field foo + And there is a nullable field foo ### alone ### diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature index 9d9d3f4a0..c193124d3 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature @@ -10,7 +10,6 @@ Feature: User can specify that a field must be a financial code type | "GB0002634946" | Then the following data should be generated: | foo | - | null | | "GB0002634946" | Scenario: Sequential isins are generated uniquely @@ -30,7 +29,6 @@ Feature: User can specify that a field must be a financial code type | "0263494" | Then the following data should be generated: | foo | - | null | | "0263494" | Scenario: An ofType constraint with the value "CUSIP" generates valid CUSIPs @@ -39,7 +37,6 @@ Feature: User can specify that a field must be a financial code type | "38259P508" | Then the following data should be generated: | foo | - | null | | "38259P508" | Scenario: Two ISIN constraints combined generate valid ISINs @@ -49,7 +46,6 @@ Feature: User can specify that a field must be a financial code type | "GB0002634946" | Then the following data should be generated: | foo | - | null | | "GB0002634946" | Scenario: A SEDOL constraint combined with another SEDOL constraint generates valid SEDOLs @@ -59,7 +55,6 @@ Feature: User can specify that a field must be a financial code type | "0263494" | Then the following data should be generated: | foo | - | null | | "0263494" | Scenario: A CUSIP constraint combined with a second CUSIP constraint generates valid CUSIPs @@ -69,7 +64,6 @@ Feature: User can specify that a field must be a financial code type | "38259P508" | Then the following data should be generated: | foo | - | null | | "38259P508" | Scenario: A RIC constraint combined with a not null constraint generates valid RICs diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AllOf.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AllOf.feature index 61adfc1ca..9e1c1f92b 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AllOf.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AllOf.feature @@ -17,7 +17,6 @@ Feature: User can specify that data must be created to conform to each of multip | "ab" | | "bb" | | "ba" | - | null | Scenario: Running an 'allOf' request that contains an invalid nested allOf request should generate null Given there is a non nullable field foo @@ -29,7 +28,6 @@ Feature: User can specify that data must be created to conform to each of multip And foo is longer than 4 Then the following data should be generated: | foo | - | null | Scenario: Running a 'allOf' request that includes multiple values within the same statement should be successful Given there is a non nullable field foo From 033735c4b1048df01f69a7e4dca143b46920890e Mon Sep 17 00:00:00 2001 From: JHarrisSL Date: Mon, 21 Oct 2019 13:16:14 +0100 Subject: [PATCH 05/10] Rename ccumber step thereAreFields so there is no thereAreNullableFields and thereAreNonNullableFields --- docs/archive/developer/CucumberSyntax.md | 2 +- docs/developer/CucumberCookbook.md | 2 +- .../cucumber/features/ComplexProfiles.feature | 2 +- .../features/ExhaustiveCombination.feature | 40 +++++++++---------- .../features/operators/general/InMap.feature | 6 +-- .../features/operators/general/InSet.feature | 2 +- .../features/operators/grammatical/If.feature | 2 +- .../testframework/steps/GeneralTestStep.java | 9 ++++- 8 files changed, 35 insertions(+), 30 deletions(-) diff --git a/docs/archive/developer/CucumberSyntax.md b/docs/archive/developer/CucumberSyntax.md index aff54af02..f616ed94a 100644 --- a/docs/archive/developer/CucumberSyntax.md +++ b/docs/archive/developer/CucumberSyntax.md @@ -38,7 +38,7 @@ foo is greaterThan 5 Operators are converted to English language equivalents for use in cucumber, so 'greaterThan' is expressed as 'greater than'. * _there is a non nullable field `{field}`_, adds a field called `field` to the profile -* _the following fields exist:_, adds a set of fields to the profile (is followed by a single column set of strings, each represents a field name) +* _the following non nullable fields exist:_, adds a set of fields to the profile (is followed by a single column set of strings, each represents a field name) * _`{field}` is null_, adds a null constraint to the profile for the field `field` * _`{field}` is anything but null_, adds a not(is null) constraint to the profile for field `field` * _`{field}` is `{operator}` `{operand}`_, adds an `operator` constraint to the field `field` with the data `operand`, see **operators** and **operands** sections below diff --git a/docs/developer/CucumberCookbook.md b/docs/developer/CucumberCookbook.md index e1419dc5c..458d6be94 100644 --- a/docs/developer/CucumberCookbook.md +++ b/docs/developer/CucumberCookbook.md @@ -20,7 +20,7 @@ foo is greaterThan 5 Operators are converted to English language equivalents for use in cucumber, so 'greaterThan' is expressed as 'greater than'. * _there is a non nullable field `{field}`_, adds a field called `field` to the profile -* _the following fields exist:_, adds a set of fields to the profile (is followed by a single column set of strings, each represents a field name) +* _the following non nullable fields exist:_, adds a set of fields to the profile (is followed by a single column set of strings, each represents a field name) * _`{field}` is null_, adds a null constraint to the profile for the field `field` * _`{field}` is anything but null_, adds a not(is null) constraint to the profile for field `field` * _`{field}` is `{operator}` `{operand}`_, adds an `operator` constraint to the field `field` with the data `operand`, see **operators** and **operands** sections below diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ComplexProfiles.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ComplexProfiles.feature index f964688cf..446904c05 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ComplexProfiles.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ComplexProfiles.feature @@ -3,7 +3,7 @@ Feature: Generator can produce correct data for complex profiles. Scenario: Running a random strategy on a profile where there are hard to detect contradictions within or statements does not crash Given the generation strategy is Random And the generator can generate at most 5 rows - And the following fields exist: + And the following non nullable fields exist: | foo | | bar | And foo has type "integer" diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ExhaustiveCombination.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ExhaustiveCombination.feature index 3e9c4b40c..a4da4b367 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ExhaustiveCombination.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ExhaustiveCombination.feature @@ -7,7 +7,7 @@ Feature: User can create data across multiple fields for all combinations availa Scenario: Running an exhaustive combination strategy with roman alphabet character (a-z) strings should be successful Given the generation strategy is full And the combination strategy is exhaustive - And the following fields exist: + And the following non nullable fields exist: | foo | | bar | And foo has type "string" @@ -28,7 +28,7 @@ Feature: User can create data across multiple fields for all combinations availa | "b" | "d" | Scenario: Running an exhaustive combination strategy with roman numeric character (0-9) strings should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "string" @@ -49,7 +49,7 @@ Feature: User can create data across multiple fields for all combinations availa | "1" | "7" | Scenario: Running an exhaustive combination strategy with plain white spaces should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "string" @@ -70,7 +70,7 @@ Feature: User can create data across multiple fields for all combinations availa | "x" | "y" | Scenario: Running an exhaustive combination strategy with valid integer values should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "integer" @@ -91,7 +91,7 @@ Feature: User can create data across multiple fields for all combinations availa | -12 | 0 | Scenario: Running an exhaustive combination strategy with valid decimal values should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "decimal" @@ -112,7 +112,7 @@ Feature: User can create data across multiple fields for all combinations availa | -12 | 0 | Scenario: Running an exhaustive combination strategy with valid date values should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "datetime" @@ -133,7 +133,7 @@ Feature: User can create data across multiple fields for all combinations availa | 2018-12-05T14:00:00.000Z | 2010-12-31T23:59:00.000Z | Scenario: Running an exhaustive combination strategy with invalid date values should fail with an appropriate error message - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "datetime" @@ -150,7 +150,7 @@ Feature: User can create data across multiple fields for all combinations availa And no data is created Scenario: Running an exhaustive combination strategy with null values (null) should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "integer" @@ -166,7 +166,7 @@ Feature: User can create data across multiple fields for all combinations availa Then the profile is invalid because "Cannot create an IsInSetConstraint for field 'bar' with a set containing null" Scenario: Running an exhaustive combination strategy should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "integer" @@ -187,7 +187,7 @@ Feature: User can create data across multiple fields for all combinations availa | 1 | 1 | Scenario: Running an exhaustive combination strategy with a string and an integer field should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "string" @@ -208,7 +208,7 @@ Feature: User can create data across multiple fields for all combinations availa | "y" | 1 | Scenario: Running an exhaustive combination strategy with a string and a decimal field should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "string" @@ -229,7 +229,7 @@ Feature: User can create data across multiple fields for all combinations availa | "y" | 1 | Scenario: Running an exhaustive combination strategy with a string and a datetime field should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "string" @@ -250,7 +250,7 @@ Feature: User can create data across multiple fields for all combinations availa | "y" | 2010-12-31T23:59:00.000Z | Scenario: Running an exhaustive combination strategy with an integer and a datetime field should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "integer" @@ -271,7 +271,7 @@ Feature: User can create data across multiple fields for all combinations availa | 1 | 2010-12-31T23:59:00.000Z | Scenario: Running an exhaustive combination strategy with a decimal and a datetime field should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | bar | And foo has type "decimal" @@ -292,7 +292,7 @@ Feature: User can create data across multiple fields for all combinations availa | 1.1 | 2010-12-31T23:59:00.000Z | Scenario: Running an exhaustive combination strategy across five fields should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo1 | | foo2 | | foo3 | @@ -360,7 +360,7 @@ Feature: User can create data across multiple fields for all combinations availa Scenario: Running an exhaustive combination strategy across three fields with five data options each should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo1 | | foo2 | | foo3 | @@ -518,7 +518,7 @@ Feature: User can create data across multiple fields for all combinations availa Scenario: Running an exhaustive combination strategy across fields with an uneven distribution of data options should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo1 | | foo2 | | foo3 | @@ -559,7 +559,7 @@ Feature: User can create data across multiple fields for all combinations availa | 1 | 22 | 14 | Scenario: Running an exhaustive combination strategy across fields with a duplicate integer data option in a field should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo1 | | foo2 | | foo3 | @@ -590,7 +590,7 @@ Feature: User can create data across multiple fields for all combinations availa | 1 | 20 | 14 | Scenario: Running an exhaustive combination strategy across fields with non ordered data options should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo1 | | foo2 | | foo3 | @@ -642,7 +642,7 @@ Feature: User can create data across multiple fields for all combinations availa Scenario: Running an exhaustive combination strategy that includes an "if" statement should be successful Given the generation strategy is full And the combination strategy is exhaustive - And the following fields exist: + And the following non nullable fields exist: | foo1 | | foo2 | | foo3 | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InMap.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InMap.feature index 2cc651e43..f8d32b4fe 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InMap.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InMap.feature @@ -5,7 +5,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o ### inMap alone ### Scenario: Running an 'inMap' - Given the following fields exist: + Given the following non nullable fields exist: |HomeNation | |Capital | And the file "testFile" contains the following data: @@ -26,7 +26,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o |"Wales" |"Cardiff" | Scenario: Running an 'inMap' with text a restriction - Given the following fields exist: + Given the following non nullable fields exist: |HomeNation | |Capital | And the file "testFile" contains the following data: @@ -47,7 +47,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o Scenario: Running an 'inMap' multiple maps - Given the following fields exist: + Given the following non nullable fields exist: |HomeNation | |Capital | |Foo | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature index 546b0ea04..1e09f1f7a 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature @@ -1427,7 +1427,7 @@ Feature: User can specify that a field value belongs to a set of predetermined o Scenario: Running a 'inSet' request as part of an if constraint should be successful - Given the following fields exist: + Given the following non nullable fields exist: | foo | | price | And foo has type "string" diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature index 3a27935d5..4caf70d5b 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature @@ -3,7 +3,7 @@ Feature: Values can be specified by using if, then and else constraints Background: Given the generation strategy is full And the combination strategy is exhaustive - And the following fields exist: + And the following non nullable fields exist: | foo | | bar | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/GeneralTestStep.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/GeneralTestStep.java index 1c42ab4f6..c0f373d7b 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/GeneralTestStep.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/GeneralTestStep.java @@ -59,8 +59,13 @@ public void thereIsANonNullableField(String fieldName) { this.state.addNonNullableField(fieldName); } - @Given("^the following fields exist:$") - public void thereAreFields(List fields) { + @Given("^the following nullable fields exist:$") + public void thereAreNullableFields(List fields) { + fields.forEach(this::thereIsANullableField); + } + + @Given("^the following non nullable fields exist:$") + public void thereAreNonNullableFields(List fields) { fields.forEach(this::thereIsANonNullableField); } From cc3e85d7646f5d6d9c7aaee14a7cde334b219df5 Mon Sep 17 00:00:00 2001 From: JHarrisSL Date: Mon, 21 Oct 2019 14:45:13 +0100 Subject: [PATCH 06/10] Update cucumber tests to use new non-null by default behaviour of FieldDTO 2 --- .../features/operators/grammatical/If.feature | 2 +- .../operators/numeric/GreaterThan.feature | 2 +- .../numeric/GreaterThanOrEqualTo.feature | 2 +- .../operators/numeric/LessThan.feature | 2 +- .../numeric/LessThanOrEqualTo.feature | 2 +- .../operators/string/CharacterSet.feature | 1 - .../operators/string/ContainingRegex.feature | 2 +- .../operators/string/LongerThan.feature | 2 +- .../string/MatchingRegex-SpecialChars.feature | 1 - .../operators/string/MatchingRegex.feature | 88 ++++--------------- .../operators/string/OfLength.feature | 2 +- .../operators/string/ShorterThan.feature | 2 +- .../features/operators/temporal/After.feature | 2 +- .../operators/temporal/Before.feature | 2 +- .../reader/JsonProfileReaderTests.java | 51 ++++------- 15 files changed, 47 insertions(+), 116 deletions(-) diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature index 4caf70d5b..90eac01d6 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature @@ -3,7 +3,7 @@ Feature: Values can be specified by using if, then and else constraints Background: Given the generation strategy is full And the combination strategy is exhaustive - And the following non nullable fields exist: + And the following nullable fields exist: | foo | | bar | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature index 88b0c595a..f4fec5ed4 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature @@ -2,7 +2,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Background: Given the generation strategy is full - And there is a non nullable field foo + And there is a nullable field foo ###Integer diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature index 2619a40c8..0ba44ea06 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature @@ -2,7 +2,7 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Background: Given the generation strategy is full - And there is a non nullable field foo + And there is a nullable field foo Scenario: Running a 'greaterThanOrEqualTo' request that includes a positive integer should be successful Given foo is greater than or equal to 0 diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature index d3c9cb102..6d694c193 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature @@ -2,7 +2,7 @@ Feature: User can specify that a numeric value is lower than, but not equal to, Background: Given the generation strategy is full - And there is a non nullable field foo + And there is a nullable field foo And foo has type "decimal" Scenario: lessThan run against a non contradicting not lessThan should be successful (lessThan 5 AND not lessThan 1) diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature index e9d1831ab..b39496013 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature @@ -2,7 +2,7 @@ Feature: User can specify that a numeric value is lower than, or equal to, a spe Background: Given the generation strategy is full - And there is a non nullable field foo + And there is a nullable field foo Scenario: lessThanOrEqualTo run against a non contradicting not lessThanOrEqualToOrEqualTo should be successful Given foo is less than or equal to 5 diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/CharacterSet.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/CharacterSet.feature index 401095394..d2387e548 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/CharacterSet.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/CharacterSet.feature @@ -9,7 +9,6 @@ Feature: Strings will be generated using characters from only latin characters Given foo is matching regex /./ Then the following data should be generated: | foo | - | null | | " " | | "!" | | """ | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ContainingRegex.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ContainingRegex.feature index 8c6d36c39..b8daeaa9e 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ContainingRegex.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ContainingRegex.feature @@ -2,7 +2,7 @@ Feature: User can specify that contains a specified regex Background: Given the generation strategy is full - And there is a non nullable field foo + And there is a nullable field foo And foo has type "string" Scenario: Running a 'containingRegex' request that includes roman alphabet lowercase chars (a-z) only should be successful diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature index 7b4640ae7..f75a4ecfe 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature @@ -2,7 +2,7 @@ Feature: User can specify that a string length is longer than, a specified numbe Background: Given the generation strategy is full - And there is a non nullable field foo + And there is a nullable field foo And foo has type "string" Scenario: Running a 'longerThan' request that includes positive value should be successful diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex-SpecialChars.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex-SpecialChars.feature index b769cf0ea..25fc3be4c 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex-SpecialChars.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex-SpecialChars.feature @@ -10,5 +10,4 @@ Feature: Whilst including non-latin characters, user can specify that a value ei Given foo is matching regex /[😁-😘]{1}/ Then the following data should be generated: | foo | - | null | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature index f52d12551..3e4b8994c 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature @@ -9,7 +9,6 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /[a-z]{1}/ Then the following data should be generated: | foo | - | null | | "a" | | "b" | | "c" | @@ -41,7 +40,6 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /[A-Z]{1}/ Then the following data should be generated: | foo | - | null | | "A" | | "B" | | "C" | @@ -73,7 +71,6 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /[0-9]{1}/ Then the following data should be generated: | foo | - | null | | "0" | | "1" | | "2" | @@ -89,7 +86,6 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /[!-.]{1}/ Then the following data should be generated: | foo | - | null | | "!" | | """ | | "#" | @@ -107,21 +103,16 @@ Feature: User can specify that a value either matches or contains a specified re Scenario: Running a 'matchingRegex' request that includes special characters (non roman character maps: Hiragana) should be successful Given foo is matching regex /[あ-げ]{1}/ - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: Running a 'matchingRegex' request that includes special characters (emoji) only should be successful Given foo is matching regex /[😁-😘]{1}/ - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: Running a 'matchingRegex' request that includes anchors ^ and $ should be successful Given foo is matching regex /^[a-c]{2}$/ Then the following data should be generated: | foo | - | null | | "aa" | | "ab" | | "ac" | @@ -136,7 +127,6 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /^[a-c]{2}/ Then the following data should be generated: | foo | - | null | | "aa" | | "ab" | | "ac" | @@ -151,7 +141,6 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /[a-c]{2}$/ Then the following data should be generated: | foo | - | null | | "aa" | | "ab" | | "ac" | @@ -166,21 +155,18 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /[a]{1}/ Then the following data should be generated: | foo | - | null | | "a" | Scenario: Running a 'matchingRegex' request for a range over a single character ([a-a]) should be successful Given foo is matching regex /[a-a]{1}/ Then the following data should be generated: | foo | - | null | | "a" | Scenario: Running a 'matchingRegex' for a minimum length of 0 should be successful Given foo is matching regex /[a]{0,1}/ Then the following data should be generated: | foo | - | null | | "" | | "a" | @@ -215,7 +201,7 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /[a]{1,3}/ And foo is anything but null Then the following data should be generated: - | foo | + | bar | | "a" | | "aa" | | "aaa" | @@ -225,7 +211,6 @@ Feature: User can specify that a value either matches or contains a specified re And foo is matching regex /[b]{2}/ Then the following data should be generated: | foo | - | null | | "bb" | Scenario: matchingRegex run against a non contradicting not matchingRegex should be successful @@ -233,36 +218,28 @@ Feature: User can specify that a value either matches or contains a specified re And foo is anything but matching regex /[b]{2}/ Then the following data should be generated: | foo | - | null | | "a" | Scenario: Running a 'matchingRegex' request alongside a contradicting matchingRegex constraint should generate null Given foo is matching regex /[a]{1}/ And foo is matching regex /[b]{1}/ - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: matchingRegex run against a contradicting matchingRegex length should only generate null Given foo is matching regex /[a]{1}/ And foo is matching regex /[a]{2}/ - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: Running a 'matchingRegex' request alongside a contradicting matchingRegex constraint should generate null Given foo is matching regex /[a]{1}/ And foo is anything but matching regex /[a]{1}/ - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: Running a 'matchingRegex' request alongside a non-contradicting containingRegex constraint should be successful Given foo is matching regex /[b]{2}/ And foo is containing regex /[a-z]{1,3}/ Then the following data should be generated: | foo | - | null | | "bb" | Scenario: matchingRegex run against a non contradicting not containingRegex should be successful @@ -270,7 +247,6 @@ Feature: User can specify that a value either matches or contains a specified re And foo is anything but containing regex /[7]{1}/ Then the following data should be generated: | foo | - | null | | "a" | Scenario: matchingRegex run against a non contradicting not containingRegex should be successful @@ -279,36 +255,28 @@ Feature: User can specify that a value either matches or contains a specified re And foo is of length 1 Then the following data should be generated: | foo | - | null | | "7" | Scenario: Running a 'matchingRegex' request alongside a contradicting containingRegex constraint should generate null Given foo is matching regex /[b]{3}/ And foo is containing regex /[a]{1,2}/ - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: matchingRegex run against a contradicting containingRegex length should only generate null Given foo is matching regex /[b]{3}/ And foo is containing regex /[b]{7}/ - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: matchingRegex run against a contradicting not containingRegex should only generate null Given foo is matching regex /[a]{1}/ And foo is anything but containing regex /[a]{1}/ - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: matchingRegex run against a non contradicting ofLength should be successful Given foo is matching regex /[b]{2}/ And foo is of length 2 Then the following data should be generated: | foo | - | null | | "bb" | Scenario: matchingRegex run against a non contradicting not ofLength should be successful @@ -316,7 +284,6 @@ Feature: User can specify that a value either matches or contains a specified re And foo is anything but of length 5 Then the following data should be generated: | foo | - | null | | "a" | Scenario: not matchingRegex run against a non contradicting ofLength should be successful @@ -334,23 +301,18 @@ Feature: User can specify that a value either matches or contains a specified re Scenario: matchingRegex run against a contradicting ofLength should only generate null Given foo is matching regex /[b]{2}/ And foo is of length 1 - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: matchingRegex run against a contradicting not ofLength should only generate null Given foo is matching regex /[b]{2}/ And foo is anything but of length 2 - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: matchingRegex run against a non contradicting longerThan should be successful Given foo is matching regex /[b]{2}/ And foo is longer than 1 Then the following data should be generated: | foo | - | null | | "bb" | Scenario: matchingRegex run against a non contradicting not longerThan should be successful @@ -358,7 +320,6 @@ Feature: User can specify that a value either matches or contains a specified re And foo is anything but longer than 3 Then the following data should be generated: | foo | - | null | | "bb" | Scenario: not matchingRegex run against a non contradicting longerThan should be successful @@ -366,29 +327,23 @@ Feature: User can specify that a value either matches or contains a specified re And foo is anything but longer than 3 Then the following data should be generated: | foo | - | null | | "bb" | Scenario: matchingRegex run against a contradicting longerThan should only generate null Given foo is matching regex /[b]{2}/ And foo is longer than 2 - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: matchingRegex run against a contradicting not longerThan should only generate null Given foo is matching regex /[b]{2}/ And foo is anything but longer than 1 - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: matchingRegex run against a non contradicting shorterThan should be successful Given foo is matching regex /[b]{1}/ And foo is shorter than 2 Then the following data should be generated: | foo | - | null | | "b" | Scenario: matchingRegex run against a non contradicting not shorterThan should be successful @@ -396,7 +351,6 @@ Feature: User can specify that a value either matches or contains a specified re And foo is anything but shorter than 1 Then the following data should be generated: | foo | - | null | | "bb" | Scenario: not matchingRegex run against a non contradicting shorterThan should be successful @@ -414,25 +368,21 @@ Feature: User can specify that a value either matches or contains a specified re Scenario: matchingRegex run against a contradicting shorterThan should only generate null Given foo is matching regex /[b]{2}/ And foo is shorter than 2 - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: matchingRegex run against a contradicting not shorterThan should only generate null Given foo is matching regex /[b]{1}/ And foo is anything but shorter than 2 - Then the following data should be generated: - | foo | - | null | + Then no data is created Scenario: Running a 'matchingRegex' and 'inSet' and 'integer' request nulls are generated last - Given there is a non nullable field bar + Given there is a nullable field bar And bar has type "string" And the combination strategy is exhaustive And foo is matching regex /[a]{1}/ And bar is in set: | "AA" | - And there is a non nullable field lee + And there is a nullable field lee And lee has type "integer" And lee is granular to 1 And lee is less than 2 @@ -443,7 +393,3 @@ Feature: User can specify that a value either matches or contains a specified re | "a" | "AA" | null | | "a" | null | 1 | | "a" | null | null | - | null | "AA" | 1 | - | null | "AA" | null | - | null | null | 1 | - | null | null | null | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature index 3adc435c9..288daac13 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature @@ -2,7 +2,7 @@ Feature: User can specify the length of generated string data using 'ofLength' Background: Given the generation strategy is full - And there is a non nullable field foo + And there is a nullable field foo And foo has type "string" Scenario Outline: Running an 'ofLength' request on a roman alphabet character string should be successful diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature index 48c68c157..8d2c46f35 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature @@ -2,7 +2,7 @@ Feature: User can specify that a string length is lower than, a specified number Background: Given the generation strategy is full - And there is a non nullable field foo + And there is a nullable field foo And foo has type "string" Scenario: Running a 'shorterThan' request using a number to specify a the length of a generated string should be successful diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/After.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/After.feature index eda5edb8a..aa60c463b 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/After.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/After.feature @@ -2,7 +2,7 @@ Feature: User can specify that a datetime date is after, but not equal to, a spe Background: Given the generation strategy is full - And there is a non nullable field foo + And there is a nullable field foo And foo has type "datetime" Scenario: 'After' valid date is successful for a single row diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/Before.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/Before.feature index a4f5bb266..4d1f78e20 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/Before.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/Before.feature @@ -2,7 +2,7 @@ Feature: User can specify that a datetime date is lower than, but not equal to, Background: Given the generation strategy is full - And there is a non nullable field foo + And there is a nullable field foo And foo has type "datetime" #Alone diff --git a/profile/src/test/java/com/scottlogic/deg/profile/reader/JsonProfileReaderTests.java b/profile/src/test/java/com/scottlogic/deg/profile/reader/JsonProfileReaderTests.java index fdce1f712..2b987c547 100644 --- a/profile/src/test/java/com/scottlogic/deg/profile/reader/JsonProfileReaderTests.java +++ b/profile/src/test/java/com/scottlogic/deg/profile/reader/JsonProfileReaderTests.java @@ -176,7 +176,7 @@ public void shouldGiveDefaultNameToUnnamedRules() throws IOException { givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\" , \"type\": \"string\"} ]," + + " \"fields\": [ { \"name\": \"foo\" , \"type\": \"string\", \"nullable\": true} ]," + " \"rules\": [" + " {" + " \"constraints\": [" + @@ -200,7 +200,7 @@ public void shouldReadNameOfNamedRules() throws IOException { givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"string\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"string\", \"nullable\": true } ]," + " \"rules\": [" + " {" + " \"rule\": \"Too rule for school\"," + @@ -260,7 +260,7 @@ public void shouldDeserialiseIsOfTypeConstraint() throws IOException { givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"string\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"string\", \"nullable\": true } ]," + " \"rules\": []" + "}"); @@ -277,7 +277,7 @@ public void shouldDeserialiseIsOfTypeConstraint_whenInteger() throws IOException givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"integer\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"integer\", \"nullable\": true } ]," + " \"rules\": []" + "}"); @@ -298,7 +298,7 @@ public void shouldDeserialiseIsEqualToConstraint() throws IOException { givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"string\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"string\", \"nullable\": true } ]," + " \"rules\": [" + " {" + " \"constraints\": [" + @@ -346,7 +346,7 @@ public void shouldDeserialiseIsOfLengthConstraint() throws IOException { givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"id\", \"type\": \"string\" } ]," + + " \"fields\": [ { \"name\": \"id\", \"type\": \"string\" , \"nullable\": true} ]," + " \"rules\": [" + " {" + " \"constraints\": [" + @@ -369,7 +369,7 @@ public void shouldDeserialiseNotWrapper() throws IOException { givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"string\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"string\", \"nullable\": true } ]," + " \"rules\": [" + " {" + " \"constraints\": [" + @@ -395,7 +395,7 @@ public void shouldDeserialiseOrConstraint() throws IOException { givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"decimal\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"decimal\", \"nullable\": true } ]," + " \"rules\": [" + " {" + " \"constraints\": [" + @@ -424,7 +424,7 @@ public void shouldDeserialiseAndConstraint() throws IOException { givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"decimal\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"decimal\", \"nullable\": true } ]," + " \"rules\": [" + " {" + " \"constraints\": [" + @@ -453,7 +453,7 @@ public void shouldDeserialiseIfConstraint() throws IOException { givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"string\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"string\", \"nullable\": true } ]," + " \"rules\": [" + " {" + " \"constraints\": [" + @@ -491,7 +491,7 @@ public void shouldDeserialiseIfConstraintWithoutElse() throws IOException { givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"string\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"string\", \"nullable\": true } ]," + " \"rules\": [" + " {" + " \"constraints\": [" + @@ -528,7 +528,7 @@ public void shouldDeserialiseOneAsNumericGranularToConstraint() throws IOExcepti givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"decimal\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"decimal\", \"nullable\": true } ]," + " \"rules\": [" + " {" + " \"constraints\": [" + @@ -554,7 +554,7 @@ public void shouldDeserialiseTenthAsNumericGranularToConstraint() throws IOExcep givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"decimal\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"decimal\", \"nullable\": true } ]," + " \"rules\": [" + " {" + " \"constraints\": [" + @@ -580,7 +580,7 @@ public void shouldDisregardTrailingZeroesInNumericGranularities() throws IOExcep givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"decimal\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"decimal\", \"nullable\": true } ]," + " \"rules\": [" + " {" + " \"constraints\": [" + @@ -606,7 +606,7 @@ public void shouldAllowValidISO8601DateTime() throws IOException { givenJson( "{" + " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { \"name\": \"foo\", \"type\": \"datetime\" } ]," + + " \"fields\": [ { \"name\": \"foo\", \"type\": \"datetime\", \"nullable\": true } ]," + " \"rules\": [" + " {" + " \"constraints\": [" + @@ -865,21 +865,6 @@ public void nullable_DoesNotAddConstraintForField_whenSetToTrue() throws IOExcep expectRules(ruleWithDescription("type-rules")); } - @Test - public void nullable_DoesNotAddConstraintForField_whenNotSet() throws IOException { - givenJson( - "{" + - " \"schemaVersion\": " + schemaVersion + "," + - " \"fields\": [ { " + - " \"name\": \"foo\"," + - " \"type\": \"integer\"" + - " } ]," + - " \"rules\": []" + - "}"); - - expectRules(ruleWithDescription("type-rules")); - } - @Test public void nullable_addsConstraintForFields_whenSetToFalse() throws IOException { givenJson( @@ -959,10 +944,12 @@ public void type_setsFieldTypeProperty_whenSetInFieldDefinition() throws IOExcep " \"schemaVersion\": " + schemaVersion + "," + " \"fields\": [ { " + " \"name\": \"foo\" ," + - " \"type\": \"decimal\"" + + " \"type\": \"decimal\" ," + + " \"nullable\": \"true\"" + " }, { " + " \"name\": \"bar\" ," + - " \"type\": \"string\"" + + " \"type\": \"string\" ," + + " \"nullable\": \"true\"" + " }]," + " \"rules\": []" + "}"); From 15c9b1741d8059d2146366a4a9862d82014073db Mon Sep 17 00:00:00 2001 From: JHarrisSL Date: Tue, 22 Oct 2019 14:56:41 +0100 Subject: [PATCH 07/10] Add example of nullable to cucumber cookbook --- docs/developer/CucumberCookbook.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developer/CucumberCookbook.md b/docs/developer/CucumberCookbook.md index 458d6be94..cb38fa10c 100644 --- a/docs/developer/CucumberCookbook.md +++ b/docs/developer/CucumberCookbook.md @@ -20,7 +20,7 @@ foo is greaterThan 5 Operators are converted to English language equivalents for use in cucumber, so 'greaterThan' is expressed as 'greater than'. * _there is a non nullable field `{field}`_, adds a field called `field` to the profile -* _the following non nullable fields exist:_, adds a set of fields to the profile (is followed by a single column set of strings, each represents a field name) +* _the following nullable fields exist:_, adds a set of fields to the profile (is followed by a single column set of strings, each represents a field name) * _`{field}` is null_, adds a null constraint to the profile for the field `field` * _`{field}` is anything but null_, adds a not(is null) constraint to the profile for field `field` * _`{field}` is `{operator}` `{operand}`_, adds an `operator` constraint to the field `field` with the data `operand`, see **operators** and **operands** sections below From 901be1e6563191437487ba6765239cd913495ce9 Mon Sep 17 00:00:00 2001 From: JHarrisSL Date: Tue, 22 Oct 2019 15:15:37 +0100 Subject: [PATCH 08/10] Correct variable name in cucumber test --- .../cucumber/features/operators/string/MatchingRegex.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature index 3e4b8994c..0cf9fd223 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature @@ -201,7 +201,7 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /[a]{1,3}/ And foo is anything but null Then the following data should be generated: - | bar | + | foo | | "a" | | "aa" | | "aaa" | From 87f158a1da63d2d63f349298ca6c96d05a3d2bcd Mon Sep 17 00:00:00 2001 From: JHarrisSL Date: Thu, 24 Oct 2019 09:09:03 +0100 Subject: [PATCH 09/10] Remove redundant \'variable is anything but null\' statements and duplicated tests. --- .../cucumber/features/ComplexProfiles.feature | 4 +- .../features/ExhaustiveCombination.feature | 96 +++++----- .../cucumber/features/Random.feature | 6 +- .../cucumber/features/Unique.feature | 13 +- .../cucumber/features/Violation.feature | 10 +- .../operators/general/EqualTo.feature | 2 +- .../operators/general/FormattedAs.feature | 6 +- .../features/operators/general/InMap.feature | 4 +- .../features/operators/general/InSet.feature | 2 - .../features/operators/general/Null.feature | 1 - .../general/OfTypeFinancialCodes.feature | 8 +- .../operators/general/OfTypeNames.feature | 2 +- .../operators/grammatical/AnyOf.feature | 14 +- .../features/operators/grammatical/If.feature | 181 +++--------------- .../numeric/FieldDependencies.feature | 4 +- .../numeric/GranularTo-Decimal.feature | 6 +- .../operators/numeric/GreaterThan.feature | 26 +-- .../numeric/GreaterThanOrEqualTo.feature | 16 +- .../operators/numeric/LessThan.feature | 6 +- .../numeric/LessThanOrEqualTo.feature | 4 +- .../operators/string/LongerThan.feature | 2 +- .../operators/string/MatchingRegex.feature | 2 +- .../operators/string/OfLength.feature | 2 +- .../operators/string/ShorterThan.feature | 2 +- .../operators/temporal/AfterOrAt.feature | 2 +- .../operators/temporal/BeforeOrAt.feature | 2 +- .../DateTimeOtherField-Multiple.feature | 66 +++---- .../temporal/DateTimeOtherField.feature | 4 +- .../temporal/GranularTo-DateTime.feature | 2 +- .../cucumber/features/types/Decimal.feature | 2 +- .../cucumber/features/types/Integer.feature | 2 +- 31 files changed, 187 insertions(+), 312 deletions(-) diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ComplexProfiles.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ComplexProfiles.feature index 446904c05..f939d83a7 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ComplexProfiles.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ComplexProfiles.feature @@ -7,9 +7,9 @@ Feature: Generator can produce correct data for complex profiles. | foo | | bar | And foo has type "integer" - And foo is anything but null + And bar has type "integer" - And bar is anything but null + And Any Of the next 2 constraints And All Of the next 3 constraints And Any Of the next 2 constraints diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ExhaustiveCombination.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ExhaustiveCombination.feature index a4da4b367..aa68bb514 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ExhaustiveCombination.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ExhaustiveCombination.feature @@ -11,9 +11,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "string" - And foo is anything but null + And bar has type "string" - And bar is anything but null + And foo is in set: | "a" | | "b" | @@ -32,9 +32,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "string" - And foo is anything but null + And bar has type "string" - And bar is anything but null + And foo is in set: | "0" | | "1" | @@ -53,9 +53,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "string" - And foo is anything but null + And bar has type "string" - And bar is anything but null + And foo is in set: | " " | | "x" | @@ -74,9 +74,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "integer" - And foo is anything but null + And bar has type "integer" - And bar is anything but null + And foo is in set: | 999 | | -12 | @@ -95,9 +95,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "decimal" - And foo is anything but null + And bar has type "decimal" - And bar is anything but null + And foo is in set: | 999 | | -12 | @@ -116,9 +116,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "datetime" - And foo is anything but null + And bar has type "datetime" - And bar is anything but null + And foo is in set: | 2018-12-04T14:00:00.000Z | | 2018-12-05T14:00:00.000Z | @@ -137,9 +137,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "datetime" - And foo is anything but null + And bar has type "datetime" - And bar is anything but null + And foo is in set: | 2018-12-99T14:00:00.000Z | | 2018-12-05T14:00:00.000Z | @@ -154,9 +154,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "integer" - And foo is anything but null + And bar has type "integer" - And bar is anything but null + And foo is in set: | 0 | | 1 | @@ -170,9 +170,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "integer" - And foo is anything but null + And bar has type "integer" - And bar is anything but null + And foo is in set: | 0 | | 1 | @@ -191,9 +191,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "string" - And foo is anything but null + And bar has type "integer" - And bar is anything but null + And foo is in set: | "x" | | "y" | @@ -212,9 +212,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "string" - And foo is anything but null + And bar has type "decimal" - And bar is anything but null + And foo is in set: | "x" | | "y" | @@ -233,9 +233,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "string" - And foo is anything but null + And bar has type "datetime" - And bar is anything but null + And foo is in set: | "x" | | "y" | @@ -254,9 +254,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "integer" - And foo is anything but null + And bar has type "datetime" - And bar is anything but null + And foo is in set: | 500 | | 1 | @@ -275,9 +275,9 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "decimal" - And foo is anything but null + And bar has type "datetime" - And bar is anything but null + And foo is in set: | 500 | | 1.1 | @@ -299,15 +299,15 @@ Feature: User can create data across multiple fields for all combinations availa | foo4 | | foo5 | And foo1 has type "integer" - And foo1 is anything but null + And foo2 has type "integer" - And foo2 is anything but null + And foo3 has type "integer" - And foo3 is anything but null + And foo4 has type "integer" - And foo4 is anything but null + And foo5 has type "integer" - And foo5 is anything but null + And foo1 is in set: | 1 | | 2 | @@ -365,11 +365,11 @@ Feature: User can create data across multiple fields for all combinations availa | foo2 | | foo3 | And foo1 has type "integer" - And foo1 is anything but null + And foo2 has type "integer" - And foo2 is anything but null + And foo3 has type "integer" - And foo3 is anything but null + And foo1 is in set: | 1 | | 2 | @@ -523,11 +523,11 @@ Feature: User can create data across multiple fields for all combinations availa | foo2 | | foo3 | And foo1 has type "integer" - And foo1 is anything but null + And foo2 has type "integer" - And foo2 is anything but null + And foo3 has type "integer" - And foo3 is anything but null + And foo1 is in set: | 1 | And foo2 is in set: @@ -564,11 +564,11 @@ Feature: User can create data across multiple fields for all combinations availa | foo2 | | foo3 | And foo1 has type "integer" - And foo1 is anything but null + And foo2 has type "integer" - And foo2 is anything but null + And foo3 has type "integer" - And foo3 is anything but null + And foo1 is in set: | 1 | And foo2 is in set: @@ -595,11 +595,11 @@ Feature: User can create data across multiple fields for all combinations availa | foo2 | | foo3 | And foo1 has type "integer" - And foo1 is anything but null + And foo2 has type "string" - And foo2 is anything but null + And foo3 has type "string" - And foo3 is anything but null + And foo1 is in set: | 1 | | 0 | @@ -647,11 +647,11 @@ Feature: User can create data across multiple fields for all combinations availa | foo2 | | foo3 | And foo1 has type "string" - And foo1 is anything but null + And foo2 has type "integer" - And foo2 is anything but null + And foo3 has type "string" - And foo3 is anything but null + And foo1 is in set: | "alpha" | And foo2 is in set: diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature index 4d83bbbc7..51e92b33e 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature @@ -61,21 +61,21 @@ Feature: User can generate valid data for all types (string, integer, decimal, o Scenario: The generator produces valid ISIN data in random mode (general format is checked here, not the checksum) Given foo has type "ISIN" - And foo is anything but null + And the generator can generate at most 5 rows Then 5 rows of data are generated And foo contains strings matching /[A-Z]{2}[A-Z0-9]{9}[0-9]{1}/ Scenario: The generator produces valid SEDOL data in random mode (general format is checked here, not the checksum) Given foo has type "SEDOL" - And foo is anything but null + And the generator can generate at most 5 rows Then 5 rows of data are generated And foo contains strings matching /[B-DF-HJ-NP-TV-Z0-9]{6}[0-9]/ Scenario: The generator produces valid CUSIP data in random mode (general format is checked here, not the checksum) Given foo has type "CUSIP" - And foo is anything but null + And the generator can generate at most 5 rows Then 5 rows of data are generated And foo contains strings matching /[0-9]{3}[A-Z0-9]{5}[0-9]/ diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Unique.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Unique.feature index f59a902cb..1ab5f7a12 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Unique.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Unique.feature @@ -7,7 +7,6 @@ Feature: As a user And unique is unique And unique has type "integer" And unique is greater than 0 - And unique is anything but null And the combination strategy is minimal And the generator can generate at most 5 rows @@ -16,7 +15,7 @@ Feature: As a user And foo is unique And foo has type "integer" And foo is greater than 0 - And foo is anything but null + And there is a non nullable field bar And bar has type "string" And bar is equal to "not unique" @@ -34,7 +33,7 @@ Feature: As a user And there is a non nullable field foo And foo has type "integer" And foo is greater than 0 - And foo is anything but null + Then the following data should be generated: |unique | foo | | 1 | 1 | @@ -45,12 +44,12 @@ Feature: As a user And foo has type "integer" And foo is greater than 0 And foo is less than 4 - And foo is anything but null + And there is a non nullable field bar And bar has type "integer" And bar is greater than 0 And bar is less than 4 - And bar is anything but null + Then the following data should be generated: |unique | foo | bar| | 1 | 1 | 1 | @@ -65,11 +64,11 @@ Feature: As a user And foo has type "integer" And foo is greater than 0 And foo is less than 4 - And foo is anything but null + And there is a non nullable field bar And bar has type "integer" And bar is greater than 0 And bar is less than 4 - And bar is anything but null + Then the profile is invalid because "Unique fields do not work when not using Minimal combination strategy" And no data is created diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature index 1689f5cb7..5fd99c2f2 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature @@ -46,7 +46,7 @@ Feature: The violations mode of the Data Helix app can be run in violations mode Scenario: The generator produces violating (not type) 'DateTime' data in random mode Given foo has type "datetime" And the generation strategy is random - And foo is anything but null + And foo is before 2019-01-01T00:00:00.000Z And the data requested is violating Then 5 rows of data are generated @@ -55,7 +55,7 @@ Feature: The violations mode of the Data Helix app can be run in violations mode Scenario: The generator produces violating (not type) 'Decimal' data in random mode Given foo has type "decimal" - And foo is anything but null + And the generation strategy is random And foo is less than 10 And the data requested is violating @@ -66,7 +66,7 @@ Feature: The violations mode of the Data Helix app can be run in violations mode Scenario: The generator produces violating (not type) 'String' data in random mode Given foo has type "string" And the generation strategy is random - And foo is anything but null + And foo is shorter than 10 And the data requested is violating Then 5 rows of data are generated @@ -76,7 +76,7 @@ Feature: The violations mode of the Data Helix app can be run in violations mode Scenario: The generator produces violating (not type) RegEx restricted 'String' data in random mode Given foo has type "string" And the generation strategy is random - And foo is anything but null + And foo is matching regex /[a-z]{0,9}/ And the data requested is violating Then 5 rows of data are generated @@ -85,7 +85,7 @@ Feature: The violations mode of the Data Helix app can be run in violations mode Scenario: The generator produces violating (not type) inverted RegEx restricted 'String' data in random mode Given foo has type "string" - And foo is anything but null + And the generation strategy is random And foo is anything but matching regex /[a-z]{0,9}/ And the data requested is violating diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature index 707def05c..8fcf43599 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature @@ -124,7 +124,7 @@ Feature: User can specify that a value is equalTo a required value Given there is a non nullable field foo And foo has type "decimal" And foo is equal to 15 - And foo is anything but null + Then the following data should be generated: | foo | | 15 | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/FormattedAs.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/FormattedAs.feature index d161b22a3..da21e6a25 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/FormattedAs.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/FormattedAs.feature @@ -10,7 +10,7 @@ Feature: User can specify that a value is so formatted | | And foo has type "decimal" And foo has formatting - And foo is anything but null + Then the following data should be generated: | foo | | | @@ -61,7 +61,7 @@ Feature: User can specify that a value is so formatted | | And foo has type "string" And foo has formatting - And foo is anything but null + Then the following data should be generated: | foo | | | @@ -79,7 +79,7 @@ Feature: User can specify that a value is so formatted | | And foo has type "datetime" And foo has formatting - And foo is anything but null + Then the following data should be generated: | foo | | | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InMap.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InMap.feature index f8d32b4fe..cb5de7dab 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InMap.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InMap.feature @@ -55,8 +55,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o And the combination strategy is exhaustive And HomeNation is anything but null And Capital is anything but null - And Foo is anything but null - And Bar is anything but null + + And the file "testFile" contains the following data: |Country |Capital | |England |London | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature index 1e09f1f7a..211740614 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature @@ -1443,8 +1443,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Test2" | And price is equal to 1 And price is equal to 2 - And foo is anything but null - And price is anything but null Then the following data should be generated: | foo | price | | "Test1" | 1 | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature index 8caaf08f7..4869be4c3 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature @@ -40,7 +40,6 @@ Feature: User can specify that a field is null or absent Scenario: Not 'null' with not 'null' is successful Given foo is anything but null - And foo is anything but null And foo has type "string" And foo is equal to "a" Then the following data should be generated: diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature index c193124d3..5d7db472a 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature @@ -14,7 +14,7 @@ Feature: User can specify that a field must be a financial code type Scenario: Sequential isins are generated uniquely Given foo has type "ISIN" - And foo is anything but null + And the generator can generate at most 4 rows Then the following data should be generated: | foo | @@ -68,7 +68,7 @@ Feature: User can specify that a field must be a financial code type Scenario: A RIC constraint combined with a not null constraint generates valid RICs Given foo has type "RIC" - And foo is anything but null + And foo is in set: | "AB.PQ" | Then the following data should be generated: @@ -77,7 +77,7 @@ Feature: User can specify that a field must be a financial code type Scenario: A RIC constraint combined with a not null constraint and an in set constraint that does not contain any valid RICs generates no data Given foo has type "RIC" - And foo is anything but null + And foo is in set: | "NOPE" | Then the following data should be generated: @@ -85,7 +85,7 @@ Feature: User can specify that a field must be a financial code type Scenario: A RIC constraint combined with an of length constraint returns valid RICs of the specified length Given foo has type "RIC" - And foo is anything but null + And foo is of length 6 And foo is in set: | "AB.PQ" | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeNames.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeNames.feature index 9f79c2b54..d31b4937a 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeNames.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeNames.feature @@ -4,7 +4,7 @@ Feature: User can specify that a field must be a type of name Given the generation strategy is random And there is a non nullable field foo And foo has type "string" - And foo is anything but null + Scenario: Generating with an of type firstname constraint generates valid firstnames Given foo has type "firstname" diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AnyOf.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AnyOf.feature index 5543a8dea..33d51e164 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AnyOf.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AnyOf.feature @@ -15,7 +15,7 @@ Feature: Values can be specified by using any of to set multiple constraints | "Test5" | And foo is matching regex /[a-b]{4}/ And foo has type "string" - And foo is anything but null + Then the following data should be generated: | foo | | "Test0" | @@ -58,7 +58,7 @@ Feature: Values can be specified by using any of to set multiple constraints | "Test8" | | "Test9" | And foo has type "string" - And foo is anything but null + Then no data is created Scenario: Running an 'anyOf' request that contains a valid nested anyOf request should be successful @@ -74,7 +74,7 @@ Feature: Values can be specified by using any of to set multiple constraints | "4444" | | "55555" | And foo has type "string" - And foo is anything but null + Then the following data should be generated: | foo | | "1" | @@ -97,7 +97,7 @@ Feature: Values can be specified by using any of to set multiple constraints | "4444" | | "55555" | And foo has type "string" - And foo is anything but null + Then the following data should be generated: | foo | | "1" | @@ -113,7 +113,7 @@ Feature: Values can be specified by using any of to set multiple constraints And Any Of the next 1 constraints And foo is of length -1 And foo has type "string" - And foo is anything but null + Then the profile is invalid because "String length must have a value >= 0, currently is -1" And no data is created @@ -123,7 +123,7 @@ Feature: Values can be specified by using any of to set multiple constraints And All Of the next 1 constraints And foo is of length -1 And foo has type "string" - And foo is anything but null + Then the profile is invalid because "String length must have a value >= 0, currently is -1" And no data is created @@ -140,7 +140,7 @@ Feature: Values can be specified by using any of to set multiple constraints | "9" | | "a1" | | "B" | - And foo is anything but null + Then the following data should be generated: | foo | | "a" | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature index 90eac01d6..2002eef77 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature @@ -33,7 +33,6 @@ Feature: Values can be specified by using if, then and else constraints | "b" | And foo is anything but null And foo has type "string" - And bar is anything but null And bar has type "decimal" When If Then and Else are described below And foo is equal to "a" @@ -56,7 +55,6 @@ Feature: Values can be specified by using if, then and else constraints | "b" | And foo has type "decimal" And bar has type "string" - And bar is anything but null When If Then and Else are described below And Any Of the next 2 constraints And foo is equal to 1 @@ -82,7 +80,7 @@ Feature: Values can be specified by using if, then and else constraints | "b" | And foo has type "decimal" And bar has type "string" - And bar is anything but null + When If Then and Else are described below And All Of the next 2 constraints And foo is greater than 1 @@ -108,7 +106,7 @@ Feature: Values can be specified by using if, then and else constraints | "b" | And foo has type "decimal" And bar has type "string" - And bar is anything but null + When If Then and Else are described below And foo is anything but equal to 1 And bar is equal to "a" @@ -133,7 +131,7 @@ Feature: Values can be specified by using if, then and else constraints | "c" | And foo has type "decimal" And bar has type "string" - And bar is anything but null + When If Then and Else are described below And foo is greater than 1 When If Then and Else are described below @@ -161,7 +159,7 @@ Feature: Values can be specified by using if, then and else constraints | "c" | And foo has type "decimal" And bar has type "string" - And bar is anything but null + When If Then and Else are described below And foo is equal to 5 And bar is equal to "a" @@ -186,7 +184,7 @@ Feature: Values can be specified by using if, then and else constraints | "c" | And foo has type "decimal" And bar has type "string" - And bar is anything but null + When If Then and Else are described below And foo is equal to 1 And bar is equal to "X" @@ -203,14 +201,14 @@ Feature: Values can be specified by using if, then and else constraints | 2 | | 3 | | 4 | - And foo is anything but null + And bar is in set: | "a" | | "b" | | "c" | And foo has type "decimal" And bar has type "string" - And bar is anything but null + When If Then and Else are described below And foo is equal to 1 And bar is equal to "a" @@ -232,7 +230,7 @@ Feature: Values can be specified by using if, then and else constraints | "c" | And foo has type "decimal" And bar has type "string" - And bar is anything but null + When If Then and Else are described below And foo is in set: | 1 | @@ -317,7 +315,7 @@ Feature: Values can be specified by using if, then and else constraints | "c" | And foo has type "decimal" And bar has type "string" - And bar is anything but null + When If Then and Else are described below And foo is in set: | 8 | @@ -429,7 +427,7 @@ Feature: Values can be specified by using if, then and else constraints | "a" | | "b" | | "c" | - And bar is anything but null + And foo has type "decimal" And bar has type "string" When If Then and Else are described below @@ -501,7 +499,7 @@ Feature: Values can be specified by using if, then and else constraints | "20" | | "AA" | | "BB" | - And bar is anything but null + And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -585,7 +583,7 @@ Feature: Values can be specified by using if, then and else constraints | "20" | | "AA" | | "BB" | - And bar is anything but null + When If Then and Else are described below And foo is matching regex /[0-9]{2}/ And bar is equal to "AA" @@ -657,7 +655,7 @@ Feature: Values can be specified by using if, then and else constraints | "20" | | "AA" | | "BB" | - And bar is anything but null + And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -739,7 +737,7 @@ Feature: Values can be specified by using if, then and else constraints | "20" | | "AA" | | "BB" | - And bar is anything but null + And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -753,31 +751,6 @@ Feature: Values can be specified by using if, then and else constraints | "a1" | "10" | | "b2" | "10" | - Scenario: Running an if request that contains a contradictory containingRegex constraint within its then statement should be successful - Given foo is in set: - | "1" | - | "2" | - | "a1" | - | "b2" | - And foo is anything but null - And bar is in set: - | "10" | - | "20" | - | "AA" | - | "BB" | - And bar is anything but null - And foo has type "string" - And bar has type "string" - When If Then and Else are described below - And foo is equal to "1" - And bar is containing regex /[🚫]{1}/ - And bar is equal to "10" - Then the following data should be generated: - | foo | bar | - | "2" | "10" | - | "a1" | "10" | - | "b2" | "10" | - Scenario: Running an if request that contains a contradictory containingRegex constraint within its then statement should be successful Given foo is in set: | "1" | @@ -813,7 +786,7 @@ Feature: Values can be specified by using if, then and else constraints | "22" | | "333" | | "4444" | - And bar is anything but null + And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -891,7 +864,7 @@ Feature: Values can be specified by using if, then and else constraints | "22" | | "333" | | "4444" | - And bar is anything but null + And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -965,7 +938,7 @@ Feature: Values can be specified by using if, then and else constraints | "22" | | "333" | | "4444" | - And bar is anything but null + And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -1047,7 +1020,7 @@ Feature: Values can be specified by using if, then and else constraints | "22" | | "333" | | "4444" | - And bar is anything but null + And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -1180,7 +1153,7 @@ Feature: Values can be specified by using if, then and else constraints | 22 | | 333 | | 4444 | - And bar is anything but null + And foo has type "decimal" And bar has type "decimal" When If Then and Else are described below @@ -1311,7 +1284,7 @@ Feature: Values can be specified by using if, then and else constraints | 22 | | 333 | | 4444 | - And bar is anything but null + And foo has type "decimal" And bar has type "decimal" When If Then and Else are described below @@ -1445,7 +1418,7 @@ Feature: Values can be specified by using if, then and else constraints | 22 | | 333 | | 4444 | - And bar is anything but null + And foo has type "decimal" And bar has type "decimal" When If Then and Else are described below @@ -1578,7 +1551,7 @@ Feature: Values can be specified by using if, then and else constraints | 22 | | 333 | | 4444 | - And bar is anything but null + When If Then and Else are described below And foo is less than or equal to 20 And bar is equal to 1 @@ -1787,7 +1760,7 @@ Feature: Values can be specified by using if, then and else constraints | 2010-01-03T00:00:00.000Z | | 2010-01-04T00:00:00.000Z | | 2010-01-05T00:00:00.000Z | - And bar is anything but null + And foo has type "datetime" And bar has type "datetime" When If Then and Else are described below @@ -1936,7 +1909,7 @@ Feature: Values can be specified by using if, then and else constraints | 2010-01-03T00:00:00.000Z | | 2010-01-04T00:00:00.000Z | | 2010-01-05T00:00:00.000Z | - And bar is anything but null + And foo has type "datetime" And bar has type "datetime" When If Then and Else are described below @@ -2246,7 +2219,7 @@ Feature: Values can be specified by using if, then and else constraints | 2010-01-03T00:00:00.000Z | | 2010-01-04T00:00:00.000Z | | 2010-01-05T00:00:00.000Z | - And bar is anything but null + And foo has type "datetime" And bar has type "datetime" When If Then and Else are described below @@ -2507,7 +2480,7 @@ Feature: Values can be specified by using if, then and else constraints | 30 | | 40 | | 50 | - And bar is anything but null + And foo has type "string" And bar has type "decimal" When If Then and Else are described below @@ -2538,39 +2511,7 @@ Feature: Values can be specified by using if, then and else constraints | 30 | | 40 | | 50 | - And bar is anything but null - And foo has type "string" - And bar has type "decimal" - When If Then and Else are described below - And foo is equal to "a" - And Any Of the next 2 constraints - And bar is equal to 20 - And bar is equal to 40 - And bar is equal to 50 - Then the following data should be generated: - | foo | bar | - | "a" | 20 | - | "a" | 40 | - | "b" | 50 | - | "c" | 50 | - | "d" | 50 | - | "e" | 50 | - Scenario: Running an if request that contains a non contradictory anyOf constraint within its then statement should be successful - Given foo is in set: - | "a" | - | "b" | - | "c" | - | "d" | - | "e" | - And foo is anything but null - And bar is in set: - | 10 | - | 20 | - | 30 | - | 40 | - | 50 | - And bar is anything but null And foo has type "string" And bar has type "decimal" When If Then and Else are described below @@ -2605,7 +2546,7 @@ Feature: Values can be specified by using if, then and else constraints | 30 | | 40 | | 50 | - And bar is anything but null + And foo has type "string" And bar has type "decimal" When If Then and Else are described below @@ -2628,14 +2569,14 @@ Feature: Values can be specified by using if, then and else constraints | "c" | | "d" | | "e" | - And foo is anything but null + And bar is in set: | 10 | | 20 | | 30 | | 40 | | 50 | - And bar is anything but null + And foo has type "string" And bar has type "decimal" When If Then and Else are described below @@ -2662,7 +2603,7 @@ Feature: Values can be specified by using if, then and else constraints | 333 | | 4444 | | 55555 | - And bar is anything but null + And foo has type "string" And bar has type "decimal" When If Then and Else are described below @@ -2679,68 +2620,6 @@ Feature: Values can be specified by using if, then and else constraints | "dddd" | 55555 | | "eeeee" | 55555 | - Scenario: Running an if request that contains a non contradictory allOf constraint within its then statement should be successful - Given foo is in set: - | "a" | - | "bb" | - | "ccc" | - | "dddd" | - | "eeeee" | - And foo is anything but null - And bar is in set: - | 1 | - | 22 | - | 333 | - | 4444 | - | 55555 | - And bar is anything but null - And foo has type "string" - And bar has type "decimal" - When If Then and Else are described below - And foo is equal to "a" - And All Of the next 2 constraints - And bar is greater than 20 - And bar is less than 30 - And bar is equal to 55555 - Then the following data should be generated: - | foo | bar | - | "a" | 22 | - | "bb" | 55555 | - | "ccc" | 55555 | - | "dddd" | 55555 | - | "eeeee" | 55555 | - - Scenario: Running an if request that contains a non contradictory allOf constraint within its else statement should be successful - Given foo is in set: - | "a" | - | "bb" | - | "ccc" | - | "dddd" | - | "eeeee" | - And foo is anything but null - And bar is in set: - | 1 | - | 22 | - | 333 | - | 4444 | - | 55555 | - And bar is anything but null - And foo has type "string" - And bar has type "decimal" - When If Then and Else are described below - And foo is equal to "a" - And bar is equal to 1 - And All Of the next 2 constraints - And bar is greater than 20 - And bar is less than 30 - Then the following data should be generated: - | foo | bar | - | "a" | 1 | - | "bb" | 22 | - | "ccc" | 22 | - | "dddd" | 22 | - | "eeeee" | 22 | - Scenario: Running an if request that contains a non contradictory allOf constraint within its then statement should be successful Given foo is in set: | "a" | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature index b3e3c50c5..a5bc0735d 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature @@ -8,10 +8,10 @@ Feature:As a User And there is a non nullable field foo And foo has type "integer" And foo is greater than 0 - And foo is anything but null + And there is a non nullable field bar And bar has type "integer" - And bar is anything but null + ###Integer diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GranularTo-Decimal.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GranularTo-Decimal.feature index 697416174..164512279 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GranularTo-Decimal.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GranularTo-Decimal.feature @@ -3,7 +3,7 @@ Feature: User can specify that decimal fields are granular to a certain number o Background: Given the generation strategy is full And there is a non nullable field foo - And foo is anything but null + And foo has type "decimal" Scenario: User requires to create a numeric field with data values that include a decimal value to one decimal point @@ -74,8 +74,8 @@ Feature: User can specify that decimal fields are granular to a certain number o Given foo is granular to 0.1 And the combination strategy is exhaustive And foo is greater than or equal to 1 - And foo is anything but null - And bar is anything but null + + And there is a non nullable field bar And bar has type "decimal" And bar is granular to 0.1 diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature index f4fec5ed4..30eeedded 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature @@ -9,7 +9,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that specifies an integer should be successful Given foo has type "integer" And foo is greater than 1 - And foo is anything but null + And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -22,7 +22,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that specifies an integer with trailing zeros should be successful Given foo is greater than 100 And foo has type "integer" - And foo is anything but null + And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -34,7 +34,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that specifies a decimal should be successful Given foo is greater than 100 - And foo is anything but null + And foo has type "decimal" And the generator can generate at most 5 rows Then the following data should be generated: @@ -47,7 +47,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that specifies a decimal with trailing zeros should be successful Given foo is greater than 100.0 - And foo is anything but null + And foo has type "decimal" And the generator can generate at most 5 rows Then the following data should be generated: @@ -61,7 +61,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that specifies a negative should be successful for type integer Given foo is greater than -100 And foo has type "integer" - And foo is anything but null + And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -74,7 +74,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that specifies a negative should be successful for type decimal Given foo is greater than -100 And foo has type "decimal" - And foo is anything but null + And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -87,7 +87,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that includes the value zero should be successful for type integer Given foo is greater than -1 And foo has type "integer" - And foo is anything but null + And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -100,7 +100,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that includes the value zero should be successful for type decimal Given foo is greater than -0.00000000000000000001 And foo has type "decimal" - And foo is anything but null + And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -115,7 +115,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Given foo is greater than 2 And foo is greater than 1 And foo has type "integer" - And foo is anything but null + And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -149,7 +149,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: greaterThan run against a non contradicting greaterThanOrEqualTo should be successful (greaterThan 2 AND greaterThanOrEqualTo 1) Given foo is greater than 2 And foo is greater than or equal to 1 - And foo is anything but null + And foo has type "integer" And the generator can generate at most 5 rows Then the following data should be generated: @@ -193,7 +193,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: greaterThan run against a non contradicting not lessThan should be successful (greaterThan 1 AND not lessThan 2) Given foo is greater than 1 And foo is anything but less than 2 - And foo is anything but null + And foo has type "integer" And the generator can generate at most 5 rows Then the following data should be generated: @@ -247,7 +247,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Given foo is greater than 1 And foo is anything but less than or equal to 2 And foo has type "integer" - And foo is anything but null + And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -289,7 +289,7 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: greaterThan run against a non contradicting granularTo should be successful (greaterThan 2 AND granularTo 0.1) Given foo is greater than 2 And foo is granular to 0.1 - And foo is anything but null + And foo has type "decimal" And the generator can generate at most 5 rows Then the following data should be generated: diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature index 0ba44ea06..80c8e90b1 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature @@ -7,7 +7,7 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Scenario: Running a 'greaterThanOrEqualTo' request that includes a positive integer should be successful Given foo is greater than or equal to 0 And the generator can generate at most 5 rows - And foo is anything but null + And foo has type "integer" Then the following data should be generated: | foo | @@ -20,7 +20,7 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Scenario: Running a 'greaterThanOrEqualTo' request that includes positive decimal should be successful Given foo is greater than or equal to 0.0 And the generator can generate at most 5 rows - And foo is anything but null + And foo has type "decimal" Then the following data should be generated: | foo | @@ -34,7 +34,7 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Scenario: Running a 'greaterThanOrEqualTo' request that includes a negative integer should be successful Given foo is greater than or equal to -10 And the generator can generate at most 5 rows - And foo is anything but null + And foo has type "integer" Then the following data should be generated: | foo | @@ -47,7 +47,7 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Scenario: Running a 'greaterThanOrEqualTo' request that includes 0 should be successful Given foo is greater than or equal to 0 And the generator can generate at most 5 rows - And foo is anything but null + And foo has type "integer" Then the following data should be generated: | foo | @@ -61,7 +61,7 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Given foo is greater than or equal to 5 And foo is greater than or equal to 5 And the generator can generate at most 5 rows - And foo is anything but null + And foo has type "integer" Then the following data should be generated: | foo | @@ -110,7 +110,7 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Given foo is greater than or equal to 5 And foo is anything but less than 10 And the generator can generate at most 5 rows - And foo is anything but null + And foo has type "integer" Then the following data should be generated: | foo | @@ -167,7 +167,7 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Given foo is greater than or equal to 5 And foo is anything but less than or equal to 5 And the generator can generate at most 5 rows - And foo is anything but null + And foo has type "integer" Then the following data should be generated: | foo | @@ -211,7 +211,7 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp And foo is granular to 1 And foo has type "integer" And the generator can generate at most 5 rows - And foo is anything but null + Then the following data should be generated: | foo | | 9 | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature index 6d694c193..84be54bb0 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature @@ -31,7 +31,7 @@ Feature: User can specify that a numeric value is lower than, but not equal to, Scenario: not lessThan run against a non contradicting not lessThan should be successful (not lessThan 5 AND not lessThan 5) Given foo is anything but less than 5 And foo is anything but less than 5 - And foo is anything but null + And foo has type "integer" And the generator can generate at most 5 rows Then the following data should be generated: @@ -85,7 +85,7 @@ Feature: User can specify that a numeric value is lower than, but not equal to, Scenario: not lessThan run against a non contradicting not lessThanOrEqualTo should be successful (not lessThan 3 AND not lessThanOrEqualTo 4) Given foo is anything but less than 3 And foo is anything but less than or equal to 4 - And foo is anything but null + And foo has type "integer" And the generator can generate at most 5 rows Then the following data should be generated: @@ -107,7 +107,7 @@ Feature: User can specify that a numeric value is lower than, but not equal to, Scenario: not lessThan run against a non contradicting granularTo should be successful (not lessThan 4 AND granularTo 1) Given foo is anything but less than 4 And foo is granular to 1 - And foo is anything but null + And foo has type "decimal" And the generator can generate at most 5 rows Then the following data should be generated: diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature index b39496013..34c7350cc 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature @@ -19,7 +19,7 @@ Feature: User can specify that a numeric value is lower than, or equal to, a spe And foo is anything but less than or equal to 3 And foo has type "integer" And the generator can generate at most 5 rows - And foo is anything but null + Then the following data should be generated: | foo | | 4 | @@ -41,7 +41,7 @@ Feature: User can specify that a numeric value is lower than, or equal to, a spe And the generator can generate at most 5 rows And foo has type "decimal" And foo is granular to 1 - And foo is anything but null + Then the following data should be generated: | foo | | 4 | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature index f75a4ecfe..990497452 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature @@ -244,7 +244,7 @@ Feature: User can specify that a string length is longer than, a specified numbe Given foo is longer than 999 And the generation strategy is random And the generator can generate at most 1 rows - And foo is anything but null + Then foo contains strings of length between 1000 and 1000 inclusively Scenario: longerThan with value larger than maximum permitted should fail with an error message diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature index 0cf9fd223..53dcd8463 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature @@ -199,7 +199,7 @@ Feature: User can specify that a value either matches or contains a specified re Scenario: User using matchingRegex operator to provide an exact set of values Given foo is matching regex /[a]{1,3}/ - And foo is anything but null + Then the following data should be generated: | foo | | "a" | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature index 288daac13..cd1cb6314 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature @@ -235,7 +235,7 @@ Feature: User can specify the length of generated string data using 'ofLength' Given foo is of length 1000 And the generator can generate at most 1 rows And the generation strategy is random - And foo is anything but null + Then foo contains strings of length between 1000 and 1000 inclusively Scenario: ofLength with value larger than maximum permitted should fail with an error message diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature index 8d2c46f35..e9e744996 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature @@ -70,7 +70,7 @@ Feature: User can specify that a string length is lower than, a specified number Given foo is shorter than 1001 And the generation strategy is random And the generator can generate at most 1 rows - And foo is anything but null + Then foo contains strings of length between 0 and 1000 inclusively Scenario: shorterThan with value larger than maximum permitted should fail with an error message diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/AfterOrAt.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/AfterOrAt.feature index 1302e25db..443640b52 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/AfterOrAt.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/AfterOrAt.feature @@ -4,7 +4,7 @@ Feature: User can specify that a datetime date is more than, or the same as, a s Given the generation strategy is full And there is a non nullable field foo And foo has type "datetime" - And foo is anything but null + Scenario: User requires to create a datetime field with values that are after or at a specified date Given foo is after or at 2018-01-01T00:00:00.000Z diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/BeforeOrAt.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/BeforeOrAt.feature index 9835143dd..1646f207d 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/BeforeOrAt.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/BeforeOrAt.feature @@ -4,7 +4,7 @@ Feature: User can specify that a datetime date is lower than, or the same as, a Given the generation strategy is full And there is a non nullable field foo And foo has type "datetime" - And foo is anything but null + Scenario: Running beforeOrAt request that includes datetime field with date (YYYY-MM-DD) values that has invalid date should fail Given foo is before or at 2019-15-32T00:00:00.000Z diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField-Multiple.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField-Multiple.feature index 1ccdddbe9..d237c79b5 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField-Multiple.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField-Multiple.feature @@ -12,9 +12,9 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running a "before" and "after" constraint Given the generator can generate at most 1 rows - And foo is anything but null - And bar is anything but null - And foobar is anything but null + + + And foobar is before field bar And foobar is after field foo Then the following data should be generated: @@ -23,9 +23,9 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running a "before" and "equalTo" constraint Given the generator can generate at most 1 rows - And foo is anything but null - And bar is anything but null - And foobar is anything but null + + + And foobar is before field bar And foobar is equal to field foo Then the following data should be generated: @@ -34,9 +34,9 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running an "after" and "equalTo" constraint Given the generator can generate at most 1 rows - And foo is anything but null - And bar is anything but null - And foobar is anything but null + + + And foobar is after field bar And foobar is equal to field foo Then the following data should be generated: @@ -45,9 +45,9 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running two "after" constraints Given the generator can generate at most 1 rows - And foo is anything but null - And bar is anything but null - And foobar is anything but null + + + And foobar is after field bar And foobar is after field foo Then the following data should be generated: @@ -56,9 +56,9 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running two "before" constraints switched other field constraints Given the generator can generate at most 1 rows - And foo is anything but null - And bar is anything but null - And foobar is anything but null + + + And bar is before field foobar And foo is before field foobar Then the following data should be generated: @@ -67,9 +67,9 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running two "before" constraints Given the generator can generate at most 1 rows - And foo is anything but null - And bar is anything but null - And foobar is anything but null + + + And foobar is before field bar And foobar is before field foo Then the following data should be generated: @@ -78,9 +78,9 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running two "after" switched other field constraints Given the generator can generate at most 1 rows - And foo is anything but null - And bar is anything but null - And foobar is anything but null + + + And bar is after field foobar And foo is after field foobar Then the following data should be generated: @@ -89,9 +89,9 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running linked "after" constraint Given the generator can generate at most 1 rows - And foo is anything but null - And bar is anything but null - And foobar is anything but null + + + And foobar is after field bar And bar is after field foo Then the following data should be generated: @@ -100,9 +100,9 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running linked "before" constraint Given the generator can generate at most 1 rows - And foo is anything but null - And bar is anything but null - And foobar is anything but null + + + And foobar is before field bar And bar is before field foo Then the following data should be generated: @@ -111,9 +111,9 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running linked "before" constraint with lower limit Given the generator can generate at most 1 rows - And foo is anything but null - And bar is anything but null - And foobar is anything but null + + + And foobar is before 2019-01-01T00:00:00.000Z And foobar is before field bar And bar is before field foo @@ -123,9 +123,9 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running linked "equalTo" constraint Given the generator can generate at most 1 rows - And foo is anything but null - And bar is anything but null - And foobar is anything but null + + + And foobar is equal to field bar And bar is equal to field foo Then the following data should be generated: diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField.feature index 78c478a45..317fbea5a 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField.feature @@ -4,10 +4,10 @@ Feature: running datetimes related to otherfield datetimes Given the generation strategy is full And there is a non nullable field foo And foo has type "datetime" - And foo is anything but null + And there is a non nullable field bar And bar has type "datetime" - And bar is anything but null + And the combination strategy is exhaustive Scenario: Running an "afterField" constraint allows one date to be always later than another diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/GranularTo-DateTime.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/GranularTo-DateTime.feature index 771b1c9e2..7f3b2c9ff 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/GranularTo-DateTime.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/GranularTo-DateTime.feature @@ -3,7 +3,7 @@ Feature: User can specify that datetime fields are granular to a certain unit Background: Given the generation strategy is full And there is a non nullable field foo - And foo is anything but null + And foo has type "datetime" diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Decimal.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Decimal.feature index 7415d9a13..d2274bfb0 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Decimal.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Decimal.feature @@ -4,7 +4,7 @@ Feature: User can specify that a number has type decimal and can have varying nu Given the generation strategy is full And there is a non nullable field foo And foo has type "decimal" - And foo is anything but null + ### Numeric Constraints diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Integer.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Integer.feature index fe2536394..792c0bb67 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Integer.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Integer.feature @@ -4,7 +4,7 @@ Feature: User can specify that a number has type integer and does not have any d Given the generation strategy is full And there is a non nullable field foo And foo has type "integer" - And foo is anything but null + ### Numeric Constraints From b1fa32bf47698f878a8f43f8cd91a1aaef4205a8 Mon Sep 17 00:00:00 2001 From: JHarrisSL Date: Thu, 24 Oct 2019 11:49:36 +0100 Subject: [PATCH 10/10] Autoformat cucumber tests --- .../cucumber/features/ComplexProfiles.feature | 24 +- .../features/ExhaustiveCombination.feature | 62 +---- .../cucumber/features/Random.feature | 3 - .../cucumber/features/Unique.feature | 92 ++++--- .../cucumber/features/Violation.feature | 20 +- .../operators/general/EqualTo.feature | 61 ++--- .../operators/general/FormattedAs.feature | 155 ++++++------ .../features/operators/general/InMap.feature | 88 ++++--- .../features/operators/general/InSet.feature | 193 +++++++-------- .../features/operators/general/Null.feature | 17 -- .../features/operators/general/OfType.feature | 23 +- .../general/OfTypeFinancialCodes.feature | 25 +- .../operators/general/OfTypeNames.feature | 1 - .../operators/grammatical/AllOf.feature | 10 +- .../operators/grammatical/AnyOf.feature | 41 ++-- .../features/operators/grammatical/If.feature | 85 +++---- .../numeric/FieldDependencies.feature | 97 ++++---- .../numeric/GranularTo-Decimal.feature | 7 +- .../operators/numeric/GreaterThan.feature | 22 -- .../numeric/GreaterThanOrEqualTo.feature | 9 - .../operators/numeric/LessThan.feature | 4 - .../numeric/LessThanOrEqualTo.feature | 3 - .../operators/string/CharacterSet.feature | 2 +- .../operators/string/LongerThan.feature | 2 - .../string/MatchingRegex-SpecialChars.feature | 3 +- .../operators/string/MatchingRegex.feature | 225 +++++++++--------- .../operators/string/OfLength.feature | 7 +- .../operators/string/ShorterThan.feature | 3 +- .../operators/temporal/AfterOrAt.feature | 1 - .../operators/temporal/BeforeOrAt.feature | 1 - .../DateTimeOtherField-Multiple.feature | 33 --- .../temporal/DateTimeOtherField.feature | 9 - .../temporal/GranularTo-DateTime.feature | 121 +++++----- .../cucumber/features/types/Decimal.feature | 5 - .../cucumber/features/types/Integer.feature | 5 - .../cucumber/testframework/TestRunner.java | 2 +- .../testframework/steps/BooleanValueStep.java | 3 +- .../testframework/steps/CucumberHooks.java | 2 +- .../testframework/steps/GeneralTestStep.java | 40 ++-- .../testframework/steps/JSONTestStep.java | 2 +- .../testframework/steps/MapValueStep.java | 2 +- .../testframework/steps/NullValueStep.java | 2 +- .../testframework/steps/NumericValueStep.java | 54 ++--- .../testframework/steps/RegexValueStep.java | 6 +- .../testframework/steps/SetValueStep.java | 2 +- .../testframework/steps/StringValueStep.java | 18 +- .../steps/TypeRegistryConfiguration.java | 26 +- .../utils/CucumberErrorReporter.java | 2 +- .../utils/CucumberFileReader.java | 6 +- .../utils/CucumberGenerationConfigSource.java | 4 +- .../utils/CucumberProfileReader.java | 2 +- .../utils/CucumberTestHelper.java | 21 +- .../utils/CucumberTestState.java | 121 +++++----- .../utils/GeneratorTestUtilities.java | 8 +- .../utils/InMemoryOutputTarget.java | 3 +- .../utils/ListPredicateMatcher.java | 4 +- .../testframework/utils/RowMatcher.java | 11 +- .../utils/RowsAbsentMatcher.java | 6 +- .../utils/RowsPresentMatcher.java | 6 +- .../reader/JsonProfileReaderTests.java | 3 +- 60 files changed, 754 insertions(+), 1061 deletions(-) diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ComplexProfiles.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ComplexProfiles.feature index f939d83a7..aa57b4a8f 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ComplexProfiles.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ComplexProfiles.feature @@ -7,23 +7,21 @@ Feature: Generator can produce correct data for complex profiles. | foo | | bar | And foo has type "integer" - And bar has type "integer" - And Any Of the next 2 constraints And All Of the next 3 constraints - And Any Of the next 2 constraints - And bar is equal to 1 - And bar is equal to 2 - And Any Of the next 2 constraints - And foo is equal to 1 - And bar is equal to 3 - And Any Of the next 2 constraints - And foo is equal to 2 - And bar is equal to 4 + And Any Of the next 2 constraints + And bar is equal to 1 + And bar is equal to 2 + And Any Of the next 2 constraints + And foo is equal to 1 + And bar is equal to 3 + And Any Of the next 2 constraints + And foo is equal to 2 + And bar is equal to 4 And All Of the next 2 constraints - And foo is equal to 10 - And bar is equal to 10 + And foo is equal to 10 + And bar is equal to 10 Then the following data should be generated: | foo | bar | | 10 | 10 | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ExhaustiveCombination.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ExhaustiveCombination.feature index aa68bb514..1b4a724bf 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ExhaustiveCombination.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/ExhaustiveCombination.feature @@ -11,9 +11,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "string" - And bar has type "string" - And foo is in set: | "a" | | "b" | @@ -32,9 +30,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "string" - And bar has type "string" - And foo is in set: | "0" | | "1" | @@ -53,9 +49,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "string" - And bar has type "string" - And foo is in set: | " " | | "x" | @@ -74,9 +68,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "integer" - And bar has type "integer" - And foo is in set: | 999 | | -12 | @@ -95,9 +87,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "decimal" - And bar has type "decimal" - And foo is in set: | 999 | | -12 | @@ -116,9 +106,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "datetime" - And bar has type "datetime" - And foo is in set: | 2018-12-04T14:00:00.000Z | | 2018-12-05T14:00:00.000Z | @@ -137,9 +125,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "datetime" - And bar has type "datetime" - And foo is in set: | 2018-12-99T14:00:00.000Z | | 2018-12-05T14:00:00.000Z | @@ -154,9 +140,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "integer" - And bar has type "integer" - And foo is in set: | 0 | | 1 | @@ -170,9 +154,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "integer" - And bar has type "integer" - And foo is in set: | 0 | | 1 | @@ -191,9 +173,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "string" - And bar has type "integer" - And foo is in set: | "x" | | "y" | @@ -212,9 +192,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "string" - And bar has type "decimal" - And foo is in set: | "x" | | "y" | @@ -233,9 +211,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "string" - And bar has type "datetime" - And foo is in set: | "x" | | "y" | @@ -254,9 +230,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "integer" - And bar has type "datetime" - And foo is in set: | 500 | | 1 | @@ -275,9 +249,7 @@ Feature: User can create data across multiple fields for all combinations availa | foo | | bar | And foo has type "decimal" - And bar has type "datetime" - And foo is in set: | 500 | | 1.1 | @@ -299,15 +271,10 @@ Feature: User can create data across multiple fields for all combinations availa | foo4 | | foo5 | And foo1 has type "integer" - And foo2 has type "integer" - And foo3 has type "integer" - And foo4 has type "integer" - And foo5 has type "integer" - And foo1 is in set: | 1 | | 2 | @@ -358,18 +325,14 @@ Feature: User can create data across multiple fields for all combinations availa | 2 | 4 | 6 | 8 | 9 | | 2 | 4 | 6 | 8 | 0 | - Scenario: Running an exhaustive combination strategy across three fields with five data options each should be successful Given the following non nullable fields exist: | foo1 | | foo2 | | foo3 | And foo1 has type "integer" - And foo2 has type "integer" - And foo3 has type "integer" - And foo1 is in set: | 1 | | 2 | @@ -516,18 +479,14 @@ Feature: User can create data across multiple fields for all combinations availa | 5 | 0 | 13 | | 5 | 0 | 14 | - Scenario: Running an exhaustive combination strategy across fields with an uneven distribution of data options should be successful Given the following non nullable fields exist: | foo1 | | foo2 | | foo3 | And foo1 has type "integer" - And foo2 has type "integer" - And foo3 has type "integer" - And foo1 is in set: | 1 | And foo2 is in set: @@ -564,11 +523,8 @@ Feature: User can create data across multiple fields for all combinations availa | foo2 | | foo3 | And foo1 has type "integer" - And foo2 has type "integer" - And foo3 has type "integer" - And foo1 is in set: | 1 | And foo2 is in set: @@ -595,11 +551,8 @@ Feature: User can create data across multiple fields for all combinations availa | foo2 | | foo3 | And foo1 has type "integer" - And foo2 has type "string" - And foo3 has type "string" - And foo1 is in set: | 1 | | 0 | @@ -647,11 +600,8 @@ Feature: User can create data across multiple fields for all combinations availa | foo2 | | foo3 | And foo1 has type "string" - And foo2 has type "integer" - And foo3 has type "string" - And foo1 is in set: | "alpha" | And foo2 is in set: @@ -669,12 +619,12 @@ Feature: User can create data across multiple fields for all combinations availa And foo2 is equal to 1 And foo3 is equal to "test1" And If Then and Else are described below - And foo2 is equal to 10 - And foo3 is equal to "test10" - And If Then and Else are described below - And foo2 is equal to 100 - And foo3 is equal to "test100" - And foo3 is equal to "other" + And foo2 is equal to 10 + And foo3 is equal to "test10" + And If Then and Else are described below + And foo2 is equal to 100 + And foo3 is equal to "test100" + And foo3 is equal to "other" Then the following data should be generated: | foo1 | foo2 | foo3 | | "alpha" | 1 | "test1" | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature index 51e92b33e..2da998dcc 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Random.feature @@ -61,21 +61,18 @@ Feature: User can generate valid data for all types (string, integer, decimal, o Scenario: The generator produces valid ISIN data in random mode (general format is checked here, not the checksum) Given foo has type "ISIN" - And the generator can generate at most 5 rows Then 5 rows of data are generated And foo contains strings matching /[A-Z]{2}[A-Z0-9]{9}[0-9]{1}/ Scenario: The generator produces valid SEDOL data in random mode (general format is checked here, not the checksum) Given foo has type "SEDOL" - And the generator can generate at most 5 rows Then 5 rows of data are generated And foo contains strings matching /[B-DF-HJ-NP-TV-Z0-9]{6}[0-9]/ Scenario: The generator produces valid CUSIP data in random mode (general format is checked here, not the checksum) Given foo has type "CUSIP" - And the generator can generate at most 5 rows Then 5 rows of data are generated And foo contains strings matching /[0-9]{3}[A-Z0-9]{5}[0-9]/ diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Unique.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Unique.feature index 1ab5f7a12..d1057fb9d 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Unique.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Unique.feature @@ -1,6 +1,6 @@ Feature: As a user - I want to be able to specify that a field is unique - So that I can avoid duplication issues for certain fields + I want to be able to specify that a field is unique + So that I can avoid duplication issues for certain fields Background: Given there is a non nullable field unique @@ -10,53 +10,49 @@ Feature: As a user And the combination strategy is minimal And the generator can generate at most 5 rows - Scenario: The one where there are 2 unique fields and 1 non unique field - Given there is a non nullable field foo - And foo is unique - And foo has type "integer" - And foo is greater than 0 - - And there is a non nullable field bar - And bar has type "string" - And bar is equal to "not unique" - And the generation strategy is random - Then the following data should be generated: - | unique | foo | bar | - | 1 | 1 | "not unique"| - | 2 | 2 | "not unique"| - | 3 | 3 | "not unique"| - | 4 | 4 | "not unique"| - | 5 | 5 | "not unique"| - - Scenario: The one where the range is exceeded - Given unique is less than 3 - And there is a non nullable field foo - And foo has type "integer" - And foo is greater than 0 - - Then the following data should be generated: - |unique | foo | - | 1 | 1 | - | 2 | 2 | - - Scenario: The one where combination strategy is minimal - And there is a non nullable field foo - And foo has type "integer" - And foo is greater than 0 - And foo is less than 4 + Scenario: The one where there are 2 unique fields and 1 non unique field + Given there is a non nullable field foo + And foo is unique + And foo has type "integer" + And foo is greater than 0 + And there is a non nullable field bar + And bar has type "string" + And bar is equal to "not unique" + And the generation strategy is random + Then the following data should be generated: + | unique | foo | bar | + | 1 | 1 | "not unique" | + | 2 | 2 | "not unique" | + | 3 | 3 | "not unique" | + | 4 | 4 | "not unique" | + | 5 | 5 | "not unique" | - And there is a non nullable field bar - And bar has type "integer" - And bar is greater than 0 - And bar is less than 4 + Scenario: The one where the range is exceeded + Given unique is less than 3 + And there is a non nullable field foo + And foo has type "integer" + And foo is greater than 0 + Then the following data should be generated: + | unique | foo | + | 1 | 1 | + | 2 | 2 | - Then the following data should be generated: - |unique | foo | bar| - | 1 | 1 | 1 | - | 2 | 2 | 2 | - | 3 | 3 | 3 | - | 4 | 3 | 3 | - | 5 | 3 | 3 | + Scenario: The one where combination strategy is minimal + And there is a non nullable field foo + And foo has type "integer" + And foo is greater than 0 + And foo is less than 4 + And there is a non nullable field bar + And bar has type "integer" + And bar is greater than 0 + And bar is less than 4 + Then the following data should be generated: + | unique | foo | bar | + | 1 | 1 | 1 | + | 2 | 2 | 2 | + | 3 | 3 | 3 | + | 4 | 3 | 3 | + | 5 | 3 | 3 | Scenario: The one where combination strategy is exhaustive Given the combination strategy is exhaustive @@ -64,11 +60,9 @@ Feature: As a user And foo has type "integer" And foo is greater than 0 And foo is less than 4 - And there is a non nullable field bar And bar has type "integer" And bar is greater than 0 And bar is less than 4 - Then the profile is invalid because "Unique fields do not work when not using Minimal combination strategy" And no data is created diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature index 5fd99c2f2..e6006e8aa 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/Violation.feature @@ -12,8 +12,8 @@ Feature: The violations mode of the Data Helix app can be run in violations mode And we do not violate any granular to constraints And the generation strategy is full Then the following data should be generated: - | foo | - | 8 | + | foo | + | 8 | Scenario: Running the generator in violate mode where equal to is not violated is successful Given foo is equal to 8 @@ -21,8 +21,8 @@ Feature: The violations mode of the Data Helix app can be run in violations mode And the generation strategy is full And we do not violate any equal to constraints Then the following data should be generated: - | foo | - | 8 | + | foo | + | 8 | Scenario: Running the generator in violate mode for multiple constraints with strings is successful Given the generation strategy is interesting @@ -30,11 +30,9 @@ Feature: The violations mode of the Data Helix app can be run in violations mode And foo is anything but equal to "hello" And the generator can generate at most 10 rows Then the following data should be included in what is generated: - | foo | - | "hello" | - + | foo | + | "hello" | ### Random - Scenario: The generator produces violating 'Null' data in random mode Given foo is null And foo has type "decimal" @@ -46,7 +44,6 @@ Feature: The violations mode of the Data Helix app can be run in violations mode Scenario: The generator produces violating (not type) 'DateTime' data in random mode Given foo has type "datetime" And the generation strategy is random - And foo is before 2019-01-01T00:00:00.000Z And the data requested is violating Then 5 rows of data are generated @@ -55,7 +52,6 @@ Feature: The violations mode of the Data Helix app can be run in violations mode Scenario: The generator produces violating (not type) 'Decimal' data in random mode Given foo has type "decimal" - And the generation strategy is random And foo is less than 10 And the data requested is violating @@ -66,7 +62,6 @@ Feature: The violations mode of the Data Helix app can be run in violations mode Scenario: The generator produces violating (not type) 'String' data in random mode Given foo has type "string" And the generation strategy is random - And foo is shorter than 10 And the data requested is violating Then 5 rows of data are generated @@ -76,7 +71,6 @@ Feature: The violations mode of the Data Helix app can be run in violations mode Scenario: The generator produces violating (not type) RegEx restricted 'String' data in random mode Given foo has type "string" And the generation strategy is random - And foo is matching regex /[a-z]{0,9}/ And the data requested is violating Then 5 rows of data are generated @@ -85,11 +79,9 @@ Feature: The violations mode of the Data Helix app can be run in violations mode Scenario: The generator produces violating (not type) inverted RegEx restricted 'String' data in random mode Given foo has type "string" - And the generation strategy is random And foo is anything but matching regex /[a-z]{0,9}/ And the data requested is violating Then 5 rows of data are generated And foo contains only string data And foo contains strings matching /[a-z]{0,9}/ - diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature index 8fcf43599..ecadf9887 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/EqualTo.feature @@ -4,7 +4,6 @@ Feature: User can specify that a value is equalTo a required value Given the generation strategy is full ### alone ### - Scenario: Running an 'equalTo' of a string should return only the string Given there is a non nullable field foo And foo has type "string" @@ -29,20 +28,19 @@ Feature: User can specify that a value is equalTo a required value | foo | | 2010-01-01T00:03:00.000Z | - Scenario: Running an 'equalTo' of an empty string should return only the empty string Given there is a non nullable field foo And foo has type "string" And foo is equal to "" Then the following data should be generated: - | foo | - | "" | + | foo | + | "" | Scenario: Running an 'equalTo' of null should fail with an error message - Given there is a non nullable field foo - And foo has type "string" - And foo is equal to null - Then the profile is invalid because "The equalTo constraint has null value for field foo" + Given there is a non nullable field foo + And foo has type "string" + And foo is equal to null + Then the profile is invalid because "The equalTo constraint has null value for field foo" Scenario: Running an 'equalTo' of an invalid date value should fail with an error message Given there is a non nullable field foo @@ -64,19 +62,18 @@ Feature: User can specify that a value is equalTo a required value And foo is anything but equal to "not" And foo is null Then the following data should be generated: - | foo | + | foo | | null | ### EqualTo ### - Scenario: Two equivalent 'equalTo' statements should be successful Given there is a non nullable field foo And foo has type "string" And foo is equal to "a" And foo is equal to "a" Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: A not 'equalTo' statement should have no impact on an 'equalTo' statement Given there is a non nullable field foo @@ -84,8 +81,8 @@ Feature: User can specify that a value is equalTo a required value And foo is equal to "a" And foo is anything but equal to "A" Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: Contradictory 'equalTo' statements should emit no data Given there is a non nullable field foo @@ -95,7 +92,6 @@ Feature: User can specify that a value is equalTo a required value Then no data is created ### InSet ### - Scenario: Running an 'inSet' request alongside a non-contradicting 'equalTo' constraint should return only that value Given there is a non nullable field foo And foo has type "string" @@ -119,12 +115,10 @@ Feature: User can specify that a value is equalTo a required value Then no data is created ### null ### - Scenario: 'EqualTo' and not null should be successful Given there is a non nullable field foo And foo has type "decimal" And foo is equal to 15 - Then the following data should be generated: | foo | | 15 | @@ -137,7 +131,6 @@ Feature: User can specify that a value is equalTo a required value Then no data is created ### ofType ### - Scenario Outline: 'EqualTo' should combine with type Given there is a non nullable field foo And foo is equal to @@ -146,35 +139,32 @@ Feature: User can specify that a value is equalTo a required value | foo | | | Examples: - | type | value | + | type | value | | "integer" | 1 | | "string" | "test" | | "datetime" | 2000-01-01T00:00:00.001Z | | "decimal" | 1.1 | ### constraints ### - Scenario Outline: 'EqualTo' alongside a non-contradicting should be successful Given there is a non nullable field foo And foo is equal to And foo has type And foo is Then the following data should be generated: - | foo | + | foo | | | Examples: - | operator | value | type | - | of length 1 | "a" | "string" | - | longer than 1 | "ab" | "string" | - | shorter than 1 | "" | "string" | - | matching regex /[a]{3}/ | "aaa" | "string" | - - | greater than 1 | 2 | "decimal" | - | less than 1 | 0 | "decimal" | - | greater than or equal to 1 | 1 | "decimal" | - | less than or equal to 1 | 1 | "decimal" | - | granular to 0.1 | 1.2 | "decimal" | - + | operator | value | type | + | of length 1 | "a" | "string" | + | longer than 1 | "ab" | "string" | + | shorter than 1 | "" | "string" | + | matching regex /[a]{3}/ | "aaa" | "string" | + | greater than 1 | 2 | "decimal" | + | less than 1 | 0 | "decimal" | + | greater than or equal to 1 | 1 | "decimal" | + | less than or equal to 1 | 1 | "decimal" | + | granular to 0.1 | 1.2 | "decimal" | | after 2018-01-01T00:00:00.000Z | 2019-01-01T00:00:00.000Z | "datetime" | | before 2020-01-01T00:00:00.000Z | 2019-01-01T00:00:00.000Z | "datetime" | | after or at 2019-01-01T00:00:00.000Z | 2019-01-01T00:00:00.000Z | "datetime" | @@ -182,7 +172,6 @@ Feature: User can specify that a value is equalTo a required value | granular to "seconds" | 2019-01-01T00:00:01.000Z | "datetime" | ### Max String Length ### - Scenario: 'EqualTo' request including a string of the maximum length should be successful Given there is a non nullable field foo And foo has type "string" @@ -192,7 +181,6 @@ Feature: User can specify that a value is equalTo a required value | "I am 1000 chars long jdny97XhjJE0ywt6mRMfYj1ECoNufcF3Dy2DStFmnLVHH5GcfLtLTXEG34LNgTxPvmAqYL6UCWiia23IqmzrooICtND1UtSbrsDOhQeVjNUjTNMsin6AO5oSOiLkpU0h4hctiKKg8IoZ05TrRyl8ZBg99S986vM737sSUxUv3yKj8lPOMH5ZjrgAn52D2LerAlBRvcQMoYP5mnuPidtCHT6RrHMJX44nHFeMJS6371dHMC9bDqjJRrMsnu1DWc7kUkttSPioKZbR1BDUn5s1WTM5brzWv9bgWvtFhjzHYdhMY0bxq1qXksGzAqaOkcbbUh6bCirz6N4nAt4I2aQccMQqCp5TjXAFGMLxbRO7uttWZI8GRWiXP2joA9aTw7K8Fk5rllWbGfgFHSlMHYmeGGRF8ig10LgkeVDdP7tVHyGr4O6nKV3TB61UJaHCRZUIoyPuce3SWeckv835iwVrKy9PIC5D42HBd3431GIyMy7sxpR4pWs7djW6UxhdnTC3q2MlX0aMXjDrLCAjybo89q7qJw4eEPfR2cwuc1xvSiC2RoVVlBprmLkKiDeCZPRZxxVn9QwzvPNnRsjx9nFenwfPIDf1C6MbQ22aYmxqcnxQky1gLLdPRWVYpgqzeztnBziahVuZZLob5EvFjgv5HmKnfg3DUrU2Em61l9nE0L6IYiz9xrZ0kmiDSB44cEOoubhJUwihD7PrM92pmCKXoWouigS6LSlCIX8OkQxaHRA0m2FYgtYV0H9rkK0kQfflvlF3zd7TvSjW1NGRxzjh5jGNfvkl9M9O5tpvieoM55uPi2fY9f8ZD2Eq0KjEHEcKtLNWnxdpuIVa7mzByWqkawwrhdjH0qF4RwXsGbTHhrNT7SFyBs4h1MdKEkUlrXgGlXXtSo104KsMv5qWIXRI221jjfwZZ7nl1XLSSOqLhDoWdvgiR0XPPwvLtPMBWiwqW86upHDMMcPAYKCnP" | ### Financial code types ### - Scenario: Equal to a valid ISIN combined with an ISIN constraint should generate the equal to value Given there is a non nullable field foo And foo has type "string" @@ -276,7 +264,7 @@ Feature: User can specify that a value is equalTo a required value And foo is equal to "R.IC" And foo has type "RIC" Then the following data should be generated: - | foo | + | foo | | "R.IC" | Scenario: Equal to not a RIC combined with an RIC constraint should generate no data @@ -285,4 +273,3 @@ Feature: User can specify that a value is equalTo a required value And foo is equal to "NOTRIC" And foo has type "RIC" Then no data is created - diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/FormattedAs.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/FormattedAs.feature index da21e6a25..53c67db4c 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/FormattedAs.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/FormattedAs.feature @@ -3,22 +3,20 @@ Feature: User can specify that a value is so formatted Background: Given the generation strategy is full And there is a non nullable field foo - #commented out tests not working with big decimal values Scenario Outline: Running a valid 'formattedAs' request on numbers should be successful Given foo is in set: | | And foo has type "decimal" And foo has formatting - Then the following data should be generated: | foo | | | Examples: - | input | format | expected | + | input | format | expected | # | 1.0 | "%a" | "0x1.0p0" | no way to specify float over double # | 1.5 | "%a" | "0x1.8p0" | no way to specify float over double - | 1 | "%b" | "true" | + | 1 | "%b" | "true" | # | 32 | "%c" | " " | # | 0 | "%d" | "0" | # | 1 | "%d" | "1" | @@ -32,113 +30,106 @@ Feature: User can specify that a value is so formatted # | 1111111111111111111 | "%,d" | "1,111,111,111,111,111,111" | # | 1 | "%(d" | "1" | # | -1 | "%(d" | "(1)" | - | 1.0 | "%e" | "1.000000e+00" | - | 123456789.123456789 | "%e" | "1.234568e+08" | - | 1.0 | "%f" | "1.000000" | - | -1.0 | "%f" | "-1.000000" | - | 123456789.123456789 | "%f" | "123456789.123457" | - | 1.0 | "%g" | "1.00000" | - | 123456789.123456789 | "%g" | "1.23457e+08" | + | 1.0 | "%e" | "1.000000e+00" | + | 123456789.123456789 | "%e" | "1.234568e+08" | + | 1.0 | "%f" | "1.000000" | + | -1.0 | "%f" | "-1.000000" | + | 123456789.123456789 | "%f" | "123456789.123457" | + | 1.0 | "%g" | "1.00000" | + | 123456789.123456789 | "%g" | "1.23457e+08" | # | 0 | "%o" | "0" | # | 123456789 | "%o" | "726746425" | # | -123456789 | "%o" | "37051031353" | - | 1 | "%s" | "1" | - | 1 | "%10s" | " 1" | - | 1 | "%-10s" | "1 " | + | 1 | "%s" | "1" | + | 1 | "%10s" | " 1" | + | 1 | "%-10s" | "1 " | # | 0 | "%x" | "0" | # | 1 | "%x" | "1" | # | 123456789 | "%x" | "75bcd15" | # | -123456789 | "%x" | "f8a432eb" | - | 11111111111 | "%-10s" | "11111111111" | - | 1 | "%.5s" | "1" | - | 11111111111 | "%.5s" | "11111" | - | 12345678901 | "%10.5s" | " 12345" | - - + | 11111111111 | "%-10s" | "11111111111" | + | 1 | "%.5s" | "1" | + | 11111111111 | "%.5s" | "11111" | + | 12345678901 | "%10.5s" | " 12345" | Scenario Outline: Running a valid 'formattedAs' request on strings should be successful Given foo is in set: | | And foo has type "string" And foo has formatting - Then the following data should be generated: | foo | | | Examples: - | input | format | expected | - | "1" | "%s" | "1" | - | "" | "%10s" | " " | - | "1" | "%-10s" | "1 " | - | "11111111111" | "%.5s" | "11111" | - | "12345678901" | "%10.5s" | " 12345" | - + | input | format | expected | + | "1" | "%s" | "1" | + | "" | "%10s" | " " | + | "1" | "%-10s" | "1 " | + | "11111111111" | "%.5s" | "11111" | + | "12345678901" | "%10.5s" | " 12345" | Scenario Outline: Running a valid 'formattedAs' request on datetime should be successful Given foo is in set: | | And foo has type "datetime" And foo has formatting - Then the following data should be generated: | foo | | | Examples: - | input | format | expected | - | 2018-10-10T00:00:00.000Z | "%s" | "2018-10-10T00:00Z" | - | 2018-10-10T00:00:10.000Z | "%s" | "2018-10-10T00:00:10Z" | - | 2018-10-10T00:00:01.000Z | "%s" | "2018-10-10T00:00:01Z" | - | 2018-10-10T00:00:59.100Z | "%s" | "2018-10-10T00:00:59.100Z" | - | 2018-10-10T00:00:59.001Z | "%s" | "2018-10-10T00:00:59.001Z" | - | 2018-10-10T00:00:00.000Z | "%10s" | "2018-10-10T00:00Z" | - | 2018-10-10T00:00:10.000Z | "%10s" | "2018-10-10T00:00:10Z" | - | 2018-10-10T00:00:01.000Z | "%10s" | "2018-10-10T00:00:01Z" | - | 2018-10-10T00:00:59.100Z | "%10s" | "2018-10-10T00:00:59.100Z" | - | 2018-10-10T00:00:59.001Z | "%10s" | "2018-10-10T00:00:59.001Z" | - | 2018-10-10T00:00:00.000Z | "%-10s" | "2018-10-10T00:00Z" | - | 2018-10-10T00:00:10.000Z | "%-10s" | "2018-10-10T00:00:10Z" | - | 2018-10-10T00:00:01.000Z | "%-10s" | "2018-10-10T00:00:01Z" | - | 2018-10-10T00:00:59.100Z | "%-10s" | "2018-10-10T00:00:59.100Z" | - | 2018-10-10T00:00:59.001Z | "%-10s" | "2018-10-10T00:00:59.001Z" | - | 2018-10-10T00:00:00.000Z | "%.5s" | "2018-" | - | 2018-10-10T00:00:10.000Z | "%.5s" | "2018-" | - | 2018-10-10T00:00:01.000Z | "%.5s" | "2018-" | - | 2018-10-10T00:00:59.100Z | "%.5s" | "2018-" | - | 2018-10-10T00:00:59.001Z | "%.5s" | "2018-" | - | 2018-10-10T00:00:00.000Z | "%10.5s" | " 2018-" | - | 2018-10-10T00:00:10.000Z | "%10.5s" | " 2018-" | - | 2018-10-10T00:00:01.000Z | "%10.5s" | " 2018-" | - | 2018-10-10T00:00:59.100Z | "%10.5s" | " 2018-" | - | 2018-10-10T00:00:59.001Z | "%10.5s" | " 2018-" | - | 2018-12-01T16:17:18.199Z | "%tA" | "Saturday" | - | 2018-12-01T16:17:18.199Z | "%ta" | "Sat" | - | 2018-12-01T16:17:18.199Z | "%tB" | "December" | - | 2018-12-01T16:17:18.199Z | "%tb" | "Dec" | - | 2018-12-01T16:17:18.199Z | "%tC" | "20" | + | input | format | expected | + | 2018-10-10T00:00:00.000Z | "%s" | "2018-10-10T00:00Z" | + | 2018-10-10T00:00:10.000Z | "%s" | "2018-10-10T00:00:10Z" | + | 2018-10-10T00:00:01.000Z | "%s" | "2018-10-10T00:00:01Z" | + | 2018-10-10T00:00:59.100Z | "%s" | "2018-10-10T00:00:59.100Z" | + | 2018-10-10T00:00:59.001Z | "%s" | "2018-10-10T00:00:59.001Z" | + | 2018-10-10T00:00:00.000Z | "%10s" | "2018-10-10T00:00Z" | + | 2018-10-10T00:00:10.000Z | "%10s" | "2018-10-10T00:00:10Z" | + | 2018-10-10T00:00:01.000Z | "%10s" | "2018-10-10T00:00:01Z" | + | 2018-10-10T00:00:59.100Z | "%10s" | "2018-10-10T00:00:59.100Z" | + | 2018-10-10T00:00:59.001Z | "%10s" | "2018-10-10T00:00:59.001Z" | + | 2018-10-10T00:00:00.000Z | "%-10s" | "2018-10-10T00:00Z" | + | 2018-10-10T00:00:10.000Z | "%-10s" | "2018-10-10T00:00:10Z" | + | 2018-10-10T00:00:01.000Z | "%-10s" | "2018-10-10T00:00:01Z" | + | 2018-10-10T00:00:59.100Z | "%-10s" | "2018-10-10T00:00:59.100Z" | + | 2018-10-10T00:00:59.001Z | "%-10s" | "2018-10-10T00:00:59.001Z" | + | 2018-10-10T00:00:00.000Z | "%.5s" | "2018-" | + | 2018-10-10T00:00:10.000Z | "%.5s" | "2018-" | + | 2018-10-10T00:00:01.000Z | "%.5s" | "2018-" | + | 2018-10-10T00:00:59.100Z | "%.5s" | "2018-" | + | 2018-10-10T00:00:59.001Z | "%.5s" | "2018-" | + | 2018-10-10T00:00:00.000Z | "%10.5s" | " 2018-" | + | 2018-10-10T00:00:10.000Z | "%10.5s" | " 2018-" | + | 2018-10-10T00:00:01.000Z | "%10.5s" | " 2018-" | + | 2018-10-10T00:00:59.100Z | "%10.5s" | " 2018-" | + | 2018-10-10T00:00:59.001Z | "%10.5s" | " 2018-" | + | 2018-12-01T16:17:18.199Z | "%tA" | "Saturday" | + | 2018-12-01T16:17:18.199Z | "%ta" | "Sat" | + | 2018-12-01T16:17:18.199Z | "%tB" | "December" | + | 2018-12-01T16:17:18.199Z | "%tb" | "Dec" | + | 2018-12-01T16:17:18.199Z | "%tC" | "20" | # | 2018-12-01T16:17:18.199Z | "%tc" | "Sat Dec 11 16:17:18 UTC 2018" | requires timezone information - | 2018-12-01T16:17:18.199Z | "%tD" | "12/01/18" | - | 2018-12-01T16:17:18.199Z | "%td" | "01" | - | 2018-12-01T16:17:18.199Z | "%te" | "1" | - | 2018-12-01T16:17:18.199Z | "%tF" | "2018-12-01" | - | 2018-12-01T16:17:18.199Z | "%tH" | "16" | - | 2018-12-01T16:17:18.199Z | "%th" | "Dec" | - | 2018-12-01T16:17:18.199Z | "%tI" | "04" | - | 2018-12-01T16:17:18.199Z | "%tj" | "335" | - | 2018-12-01T09:17:18.199Z | "%tk" | "9" | - | 2018-12-01T16:17:18.199Z | "%tl" | "4" | - | 2018-12-01T16:07:18.199Z | "%tM" | "07" | - | 2018-02-01T16:17:18.199Z | "%tm" | "02" | - | 2018-02-01T16:17:18.099Z | "%tN" | "099000000" | - | 2018-02-01T16:17:18.199Z | "%tp" | "pm" | + | 2018-12-01T16:17:18.199Z | "%tD" | "12/01/18" | + | 2018-12-01T16:17:18.199Z | "%td" | "01" | + | 2018-12-01T16:17:18.199Z | "%te" | "1" | + | 2018-12-01T16:17:18.199Z | "%tF" | "2018-12-01" | + | 2018-12-01T16:17:18.199Z | "%tH" | "16" | + | 2018-12-01T16:17:18.199Z | "%th" | "Dec" | + | 2018-12-01T16:17:18.199Z | "%tI" | "04" | + | 2018-12-01T16:17:18.199Z | "%tj" | "335" | + | 2018-12-01T09:17:18.199Z | "%tk" | "9" | + | 2018-12-01T16:17:18.199Z | "%tl" | "4" | + | 2018-12-01T16:07:18.199Z | "%tM" | "07" | + | 2018-02-01T16:17:18.199Z | "%tm" | "02" | + | 2018-02-01T16:17:18.099Z | "%tN" | "099000000" | + | 2018-02-01T16:17:18.199Z | "%tp" | "pm" | # | 2018-02-01T16:17:18.199Z | "%tQ" | "02" | requires timezone information - | 2018-02-01T16:17:18.199Z | "%tR" | "16:17" | - | 2018-02-01T16:17:18.199Z | "%tr" | "04:17:18 PM" | - | 2018-02-01T16:17:08.199Z | "%tS" | "08" | + | 2018-02-01T16:17:18.199Z | "%tR" | "16:17" | + | 2018-02-01T16:17:18.199Z | "%tr" | "04:17:18 PM" | + | 2018-02-01T16:17:08.199Z | "%tS" | "08" | # | 2018-02-01T16:17:18.199Z | "%ts" | "02" | requires timezone information - | 2018-02-01T16:17:18.199Z | "%tT" | "16:17:18" | - | 2018-02-01T16:17:08.199Z | "%tY" | "2018" | - | 2018-02-01T16:17:08.199Z | "%ty" | "18" | + | 2018-02-01T16:17:18.199Z | "%tT" | "16:17:18" | + | 2018-02-01T16:17:08.199Z | "%tY" | "2018" | + | 2018-02-01T16:17:08.199Z | "%ty" | "18" | # | 2018-02-01T16:17:08.199Z | "%tZ" | "08" | requires timezone information # | 2018-02-01T16:17:08.199Z | "%tz" | "08" | requires timezone information - - diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InMap.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InMap.feature index cb5de7dab..7926a5c16 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InMap.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InMap.feature @@ -2,39 +2,38 @@ Feature: User can specify that a field value belongs to a set of predetermined o Background: Given the generation strategy is full - ### inMap alone ### Scenario: Running an 'inMap' Given the following non nullable fields exist: - |HomeNation | - |Capital | + | HomeNation | + | Capital | And the file "testFile" contains the following data: - |Country |Capital | - |England |London | - |Northern Ireland |Belfast | - |Scotland |Edinburgh | - |Wales |Cardiff | + | Country | Capital | + | England | London | + | Northern Ireland | Belfast | + | Scotland | Edinburgh | + | Wales | Cardiff | And HomeNation has type "string" And Capital has type "string" And HomeNation is from Country in testFile And Capital is from Capital in testFile Then the following data should be generated: - |HomeNation |Capital | - |"England" |"London" | - |"Northern Ireland" |"Belfast" | - |"Scotland" |"Edinburgh" | - |"Wales" |"Cardiff" | + | HomeNation | Capital | + | "England" | "London" | + | "Northern Ireland" | "Belfast" | + | "Scotland" | "Edinburgh" | + | "Wales" | "Cardiff" | Scenario: Running an 'inMap' with text a restriction Given the following non nullable fields exist: - |HomeNation | - |Capital | + | HomeNation | + | Capital | And the file "testFile" contains the following data: - |Country |Capital | - |England |London | - |Northern Ireland |Belfast | - |Scotland |Edinburgh | - |Wales |Cardiff | + | Country | Capital | + | England | London | + | Northern Ireland | Belfast | + | Scotland | Edinburgh | + | Wales | Cardiff | And HomeNation has type "string" And Capital has type "string" And HomeNation is from Country in testFile @@ -42,31 +41,28 @@ Feature: User can specify that a field value belongs to a set of predetermined o When Capital is matching regex /^[BE].*/ When HomeNation is matching regex /^[S].*/ Then the following data should be generated: - |HomeNation |Capital | - |"Scotland" |"Edinburgh" | - + | HomeNation | Capital | + | "Scotland" | "Edinburgh" | Scenario: Running an 'inMap' multiple maps Given the following non nullable fields exist: - |HomeNation | - |Capital | - |Foo | - |Bar | + | HomeNation | + | Capital | + | Foo | + | Bar | And the combination strategy is exhaustive And HomeNation is anything but null And Capital is anything but null - - And the file "testFile" contains the following data: - |Country |Capital | - |England |London | - |Northern Ireland |Belfast | - |Scotland |Edinburgh | - |Wales |Cardiff | + | Country | Capital | + | England | London | + | Northern Ireland | Belfast | + | Scotland | Edinburgh | + | Wales | Cardiff | And the file "testFile2" contains the following data: - |Foo |Bar | - |1 |one | - |2 |two | + | Foo | Bar | + | 1 | one | + | 2 | two | And HomeNation has type "string" And Capital has type "string" And Foo has type "decimal" @@ -76,12 +72,12 @@ Feature: User can specify that a field value belongs to a set of predetermined o And Foo is from Foo in testFile2 And Bar is from Bar in testFile2 Then the following data should be generated: - |Country |Capital |Foo |Bar | - |"England" |"London" |1 |"one" | - |"England" |"London" |2 |"two" | - |"Northern Ireland" |"Belfast" |1 |"one" | - |"Northern Ireland" |"Belfast" |2 |"two" | - |"Scotland" |"Edinburgh" |1 |"one" | - |"Scotland" |"Edinburgh" |2 |"two" | - |"Wales" |"Cardiff" |1 |"one" | - |"Wales" |"Cardiff" |2 |"two" | + | Country | Capital | Foo | Bar | + | "England" | "London" | 1 | "one" | + | "England" | "London" | 2 | "two" | + | "Northern Ireland" | "Belfast" | 1 | "one" | + | "Northern Ireland" | "Belfast" | 2 | "two" | + | "Scotland" | "Edinburgh" | 1 | "one" | + | "Scotland" | "Edinburgh" | 2 | "two" | + | "Wales" | "Cardiff" | 1 | "one" | + | "Wales" | "Cardiff" | 2 | "two" | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature index 211740614..22e438daf 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/InSet.feature @@ -48,7 +48,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Dick Van Dyke" | | "Scunthorpe Hospital" | - Scenario: Running an 'inSet' request that includes roman character strings that include in-use values should be successful Given there is a nullable field foo And foo has type "string" @@ -99,7 +98,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "10,000" | | "1,000,000.00" | - Scenario: Running an 'inSet' request that includes roman character strings that include valid date values should be successful Given there is a non nullable field foo And foo has type "string" @@ -169,8 +167,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 0 | | 0.0 | Then the following data should be generated: - | foo | - | 0 | + | foo | + | 0 | Scenario: Running an 'inSet' request that includes a date value should be successful Given there is a non nullable field foo @@ -254,12 +252,11 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | | 2 | Then the following data should be generated: - | foo | - | 1 | - | 2 | + | foo | + | 1 | + | 2 | ### inSet ### - Scenario: Running a 'inSet' request alongside a non-contradicting inSet constraint should be successful Given there is a non nullable field foo And foo has type "string" @@ -283,8 +280,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but in set: | "A" | Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: Running a 'inSet' request alongside a contradicting inSet constraint should produce null Given there is a nullable field foo @@ -313,7 +310,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### null ### - Scenario: 'InSet' with not null is successful Given there is a nullable field foo And foo has type "decimal" @@ -337,7 +333,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### ofType ### - Scenario: 'InSet' with non-contradicting 'ofType' string should be successful Given there is a non nullable field foo And foo is in set: @@ -357,8 +352,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | And foo has type "integer" Then the following data should be generated: - | foo | - | 1 | + | foo | + | 1 | Scenario: 'InSet' with non-contradicting 'ofType' decimal should be successful Given there is a non nullable field foo @@ -366,8 +361,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | And foo has type "decimal" Then the following data should be generated: - | foo | - | 1 | + | foo | + | 1 | Scenario: 'InSet' with non-contradicting 'ofType' datetime should be successful Given there is a non nullable field foo @@ -379,7 +374,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2019-01-01T00:00:00.000Z | ### matchingRegex ### - Scenario: Running a 'inSet' request alongside a non-contradicting 'matchingRegex' constraint should be successful Given there is a non nullable field foo And foo has type "string" @@ -400,8 +394,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | And foo is anything but matching regex /[b]{1}/ Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: Not 'inSet' string value with a 'matchingRegex' of contradictory value is successful Given there is a non nullable field foo @@ -410,8 +404,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | And foo is matching regex /[b]{1}/ Then the following data should be generated: - | foo | - | "b" | + | foo | + | "b" | Scenario: 'InSet' alongside a contradicting 'matchingRegex' constraint should produce null Given there is a nullable field foo @@ -444,7 +438,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### containingRegex ### - Scenario: Running a 'inSet' request alongside a non-contradicting 'containingRegex' constraint should be successful Given there is a non nullable field foo And foo has type "string" @@ -465,8 +458,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "b" | And foo is anything but containing regex /[b]{1}/ Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: 'InSet' alongside a contradicting 'containingRegex' constraint should produce null Given there is a nullable field foo @@ -499,7 +492,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### ofLength ### - Scenario: 'InSet' with a non contradicting 'ofLength' is successful Given there is a non nullable field foo And foo has type "string" @@ -507,8 +499,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | And foo is of length 1 Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: 'InSet' with a non contradicting not 'ofLength' is successful Given there is a non nullable field foo @@ -517,8 +509,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | And foo is anything but of length 2 Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: Not 'inSet' with a non contradicting 'ofLength' is successful Given there is a non nullable field foo @@ -530,8 +522,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | | "b" | Then the following data should be generated: - | foo | - | "b" | + | foo | + | "b" | Scenario: 'InSet' with a contradicting 'ofLength' emits null Given there is a nullable field foo @@ -554,7 +546,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### longerThan ### - Scenario: 'InSet' with a non contradicting 'longerThan' is successful Given there is a non nullable field foo And foo has type "string" @@ -572,8 +563,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | And foo is anything but longer than 1 Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: Not 'inSet' with a non contradicting 'longerThan' is successful Given there is a non nullable field foo @@ -609,7 +600,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### shorterThan ### - Scenario: 'InSet' with a non contradicting 'shorterThan' is successful Given there is a non nullable field foo And foo has type "string" @@ -617,8 +607,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | And foo is shorter than 2 Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: 'InSet' with a non contradicting not 'shorterThan' is successful Given there is a non nullable field foo @@ -627,8 +617,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | And foo is anything but shorter than 1 Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: Not 'inSet' with a non contradicting 'shorterThan' is successful Given there is a non nullable field foo @@ -640,8 +630,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "a" | | "b" | Then the following data should be generated: - | foo | - | "b" | + | foo | + | "b" | Scenario: 'InSet' with a contradicting 'shorterThan' emits null Given there is a nullable field foo @@ -664,7 +654,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### Financial data types ### - Scenario: Not in set of things that are not valid ISINs combined with an ISIN constraint generates valid ISINs Given there is a non nullable field foo And foo has type "string" @@ -735,7 +724,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### greaterThan ### - Scenario: 'InSet' with a non contradicting 'greaterThan' is successful Given there is a non nullable field foo And foo has type "decimal" @@ -743,8 +731,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | And foo is greater than 1 Then the following data should be generated: - | foo | - | 2 | + | foo | + | 2 | Scenario: 'InSet' with a non contradicting not 'greaterThan' is successful Given there is a non nullable field foo @@ -753,8 +741,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | And foo is anything but greater than 1 Then the following data should be generated: - | foo | - | 1 | + | foo | + | 1 | Scenario: Not 'inSet' with a non contradicting 'greaterThan' is successful Given there is a non nullable field foo @@ -766,8 +754,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | | 2 | Then the following data should be generated: - | foo | - | 2 | + | foo | + | 2 | Scenario: 'InSet' with a contradicting 'greaterThan' emits null Given there is a nullable field foo @@ -790,7 +778,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### greaterThanOrEqualTo ### - Scenario: 'InSet' with a non contradicting 'greaterThanOrEqualTo' is successful Given there is a non nullable field foo And foo has type "decimal" @@ -798,8 +785,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | And foo is greater than or equal to 1 Then the following data should be generated: - | foo | - | 1 | + | foo | + | 1 | Scenario: 'InSet' with a non contradicting not 'greaterThanOrEqualTo' is successful Given there is a non nullable field foo @@ -808,8 +795,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | And foo is anything but greater than or equal to 2 Then the following data should be generated: - | foo | - | 1 | + | foo | + | 1 | Scenario: Not 'inSet' with a non contradicting 'greaterThanOrEqualTo' is successful Given there is a non nullable field foo @@ -821,8 +808,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | | 2 | Then the following data should be generated: - | foo | - | 2 | + | foo | + | 2 | Scenario: 'InSet' with a contradicting 'greaterThanOrEqualTo' emits null Given there is a nullable field foo @@ -845,7 +832,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### lessThan ### - Scenario: 'InSet' with a non contradicting 'lessThan' is successful Given there is a non nullable field foo And foo has type "decimal" @@ -853,8 +839,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | And foo is less than 2 Then the following data should be generated: - | foo | - | 1 | + | foo | + | 1 | Scenario: 'InSet' with a non contradicting not 'lessThan' is successful Given there is a non nullable field foo @@ -863,8 +849,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | And foo is anything but less than 1 Then the following data should be generated: - | foo | - | 1 | + | foo | + | 1 | Scenario: Not 'inSet' with a non contradicting 'lessThan' is successful Given there is a non nullable field foo @@ -877,8 +863,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | | 3 | Then the following data should be generated: - | foo | - | 2 | + | foo | + | 2 | Scenario: 'InSet' with a contradicting 'lessThan' emits null Given there is a nullable field foo @@ -901,7 +887,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### lessThanOrEqualTo ### - Scenario: 'InSet' with a non contradicting 'lessThanOrEqualTo' is successful Given there is a non nullable field foo And foo has type "decimal" @@ -909,8 +894,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | And foo is less than or equal to 1 Then the following data should be generated: - | foo | - | 1 | + | foo | + | 1 | Scenario: 'InSet' with a non contradicting not 'lessThanOrEqualTo' is successful Given there is a non nullable field foo @@ -919,8 +904,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 2 | And foo is anything but less than or equal to 1 Then the following data should be generated: - | foo | - | 2 | + | foo | + | 2 | Scenario: Not 'inSet' with a non contradicting 'lessThanOrEqualTo' is successful Given there is a non nullable field foo @@ -932,8 +917,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | | 2 | Then the following data should be generated: - | foo | - | 2 | + | foo | + | 2 | Scenario: 'InSet' with a contradicting 'lessThanOrEqualTo' emits null Given there is a nullable field foo @@ -956,7 +941,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### granularTo ### - Scenario: 'InSet' with a non contradicting 'granularTo' is successful Given there is a non nullable field foo And foo has type "decimal" @@ -964,8 +948,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 10 | And foo is granular to 1 Then the following data should be generated: - | foo | - | 10 | + | foo | + | 10 | Scenario: Integer within an inSet and a non contradicting 'granularTo' is successful Given there is a non nullable field foo @@ -976,9 +960,9 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1 | | 2.0 | Then the following data should be generated: - | foo | - | 1 | - | 2 | + | foo | + | 1 | + | 2 | Scenario: Not 'inSet' with a non contradicting 'granularTo' is successful Given there is a non nullable field foo @@ -990,8 +974,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 1.1 | | 1 | Then the following data should be generated: - | foo | - | 1 | + | foo | + | 1 | Scenario: 'InSet' with a contradicting 'granularTo' emits null Given there is a nullable field foo @@ -1004,7 +988,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### after ### - Scenario: 'InSet' with a non contradicting 'after' is successful Given there is a non nullable field foo And foo has type "datetime" @@ -1060,7 +1043,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### afterOrAt ### - Scenario: 'InSet' with a non contradicting 'afterOrAt' is successful Given there is a non nullable field foo And foo has type "datetime" @@ -1094,7 +1076,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | foo | | 2019-01-01T00:00:00.001Z | - Scenario: 'InSet' with a contradicting 'afterOrAt' emits null Given there is a nullable field foo And foo has type "datetime" @@ -1116,7 +1097,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### before ### - Scenario: 'InSet' with a non contradicting 'before' is successful Given there is a non nullable field foo And foo has type "datetime" @@ -1172,7 +1152,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | null | ### beforeOrAt ### - Scenario: 'InSet' with a non contradicting 'beforeOrAt' is successful Given there is a non nullable field foo And foo has type "datetime" @@ -1242,7 +1221,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Test 2" | | "Test 3" | - Scenario: Running a 'inSet' request alongside an ofType = integer should be successful Given there is a non nullable field foo And foo has type "integer" @@ -1252,10 +1230,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 3 | And foo has type "integer" Then the following data should be generated: - | foo | - | 1 | - | 2 | - | 3 | + | foo | + | 1 | + | 2 | + | 3 | Scenario: Running a 'inSet' request alongside an ofType = decimal should be successful Given there is a non nullable field foo @@ -1266,10 +1244,10 @@ Feature: User can specify that a field value belongs to a set of predetermined o | 3 | And foo has type "decimal" Then the following data should be generated: - | foo | - | 1 | - | 2 | - | 3 | + | foo | + | 1 | + | 2 | + | 3 | Scenario: Running a 'inSet' request alongside an ofType = datetime should be successful Given there is a non nullable field foo @@ -1310,7 +1288,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | foo | | null | - Scenario: Running a 'inSet' request alongside a non-contradicting containingRegex constraint should be successful Given there is a non nullable field foo And foo has type "string" @@ -1384,11 +1361,11 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo is anything but null And Any Of the next 2 constraints And foo is in set: - | "Test 1" | - | "Test 2" | + | "Test 1" | + | "Test 2" | And foo is in set: - | "Test 3" | - | "Test 4" | + | "Test 3" | + | "Test 4" | Then the following data should be generated: | foo | | "Test 1" | @@ -1401,11 +1378,11 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo has type "string" And All Of the next 2 constraints And foo is in set: - | "Test1" | - | "Test2" | + | "Test1" | + | "Test2" | And foo is in set: - | "Test1" | - | "Test2" | + | "Test1" | + | "Test2" | Then the following data should be generated: | foo | | "Test1" | @@ -1416,16 +1393,15 @@ Feature: User can specify that a field value belongs to a set of predetermined o And foo has type "string" And All Of the next 2 constraints And foo is in set: - | "Test 1" | - | "Test 2" | + | "Test 1" | + | "Test 2" | And foo is in set: - | "Test 3" | - | "Test 4" | + | "Test 3" | + | "Test 4" | Then the following data should be generated: | foo | | null | - Scenario: Running a 'inSet' request as part of an if constraint should be successful Given the following non nullable fields exist: | foo | @@ -1439,8 +1415,8 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Test4" | When If Then and Else are described below And foo is in set: - | "Test1" | - | "Test2" | + | "Test1" | + | "Test2" | And price is equal to 1 And price is equal to 2 Then the following data should be generated: @@ -1449,7 +1425,6 @@ Feature: User can specify that a field value belongs to a set of predetermined o | "Test2" | 1 | | "Test3" | 2 | | "Test4" | 2 | - #TODO Scenario: Running a 'inSet' request alongside a contradicting ofType = string should produce null # Given there is a non nullable field foo # And foo has type "string" diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature index 4869be4c3..f52ec5158 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/Null.feature @@ -5,7 +5,6 @@ Feature: User can specify that a field is null or absent And there is a nullable field foo ### alone ### - Scenario: Using the 'null' operator generates null values Given foo is null And foo has type "string" @@ -29,7 +28,6 @@ Feature: User can specify that a field is null or absent Then no data is created ### null ### - Scenario: 'Null' with 'null' is successful Given foo is null And foo is null @@ -47,7 +45,6 @@ Feature: User can specify that a field is null or absent | "a" | ### ofType ### - Scenario Outline: Not 'null' with 'ofType' is successful Given foo is anything but null And foo has type @@ -76,7 +73,6 @@ Feature: User can specify that a field is null or absent | "datetime" | ### matchingRegex ### - Scenario: Not 'null' with a non-contradicting 'matchingRegex' is successful Given foo is anything but null And foo has type "string" @@ -102,7 +98,6 @@ Feature: User can specify that a field is null or absent | null | ### containingRegex ### - Scenario: Not 'null' with a non contradicting 'containingRegex' is successful Given foo is anything but null And foo has type "string" @@ -133,7 +128,6 @@ Feature: User can specify that a field is null or absent | null | ### ofLength ### - Scenario: Not 'null' with a non contradicting 'ofLength' should be successful Given foo is anything but null And foo has type "string" @@ -159,7 +153,6 @@ Feature: User can specify that a field is null or absent | null | ### longerThan ### - Scenario: Not 'null' with a non contradicting 'longerThan' should be successful Given foo is anything but null And foo has type "string" @@ -188,7 +181,6 @@ Feature: User can specify that a field is null or absent | null | ### shorterThan ### - Scenario: Not 'null' with a non contradicting 'shorterThan' should be successful Given foo is anything but null And foo has type "string" @@ -215,7 +207,6 @@ Feature: User can specify that a field is null or absent | null | ### Financial data types ### - Scenario: Not null combined with an ISIN constraint generates valid ISINs Given foo is anything but null And foo has type "string" @@ -271,7 +262,6 @@ Feature: User can specify that a field is null or absent | null | ### greaterThan ### - Scenario: Not 'null' with a non contradicting 'greaterThan' should be successful Given foo is anything but null And foo has type "decimal" @@ -299,7 +289,6 @@ Feature: User can specify that a field is null or absent | null | ### greaterThanOrEqualTo ### - Scenario: Not 'null' with a non contradicting 'greaterThanOrEqualTo' should be successful Given foo is anything but null And foo has type "decimal" @@ -327,7 +316,6 @@ Feature: User can specify that a field is null or absent | null | ### lessThan ### - Scenario: 'Null' with a contradicting 'lessThan' should only generate null Given foo is null And foo has type "decimal" @@ -345,7 +333,6 @@ Feature: User can specify that a field is null or absent | null | ### lessThanOrEqualTo ### - Scenario: 'Null' with a contradicting 'lessThanOrEqualTo' should only generate null Given foo is null And foo has type "decimal" @@ -363,7 +350,6 @@ Feature: User can specify that a field is null or absent | null | ### granularTo ### - Scenario: Not 'null' with a non contradicting 'granularTo' should be successful Given foo is anything but null And foo has type "decimal" @@ -411,7 +397,6 @@ Feature: User can specify that a field is null or absent | null | ### afterOrAt ### - Scenario: Not 'null' with a non contradicting 'afterOrAt' should be successful Given foo is anything but null And foo has type "datetime" @@ -439,7 +424,6 @@ Feature: User can specify that a field is null or absent | null | ### before ### - @ignore #594 - Reverse order of value generation when only upper-bound operators are provided Scenario: Not 'null' with a non contradicting 'before' should be successful Given foo is anything but null @@ -468,7 +452,6 @@ Feature: User can specify that a field is null or absent | null | ### beforeOrAt ### - @ignore #594 - Reverse order of value generation when only upper-bound operators are provided Scenario: Not 'null' with a non contradicting 'beforeOrAt' should be successful Given foo is anything but null diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfType.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfType.feature index dc8d76e2b..77858a2e4 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfType.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfType.feature @@ -8,15 +8,16 @@ Feature: User can specify that a field is of a specific type (string, integer, d And foo is equal to 1 And foo has type "integer" Then the following data should be generated: - | foo | - | 1 | + | foo | + | 1 | + Scenario: Running an 'ofType' = integer request that includes a number value (as a string) should be successful Given there is a non nullable field foo And foo is equal to "1" And foo has type "integer" Then the following data should be generated: - | foo | - | 1 | + | foo | + | 1 | Scenario: Running an 'ofType' = decimal request that includes a decimal number value should be successful Given there is a non nullable field foo @@ -39,24 +40,24 @@ Feature: User can specify that a field is of a specific type (string, integer, d And foo is equal to -99 And foo has type "integer" Then the following data should be generated: - | foo | - | -99 | + | foo | + | -99 | Scenario: Running an 'ofType' = integer request that includes the number zero should be successful Given there is a non nullable field foo And foo is equal to 0 And foo has type "integer" Then the following data should be generated: - | foo | - | 0 | + | foo | + | 0 | Scenario: Running an 'ofType' = decimal request that includes the number zero should be successful Given there is a non nullable field foo And foo is equal to 0 And foo has type "decimal" Then the following data should be generated: - | foo | - | 0 | + | foo | + | 0 | Scenario: Running an 'ofType' = datetime request that includes a date value (not a string) should be successful Given there is a non nullable field foo @@ -104,7 +105,7 @@ Feature: User can specify that a field is of a specific type (string, integer, d | foo | | 2010-01-01 | - @ignore #pending development of 1381 - Add date time and fields + @ignore #pending development of 1381 - Add date time and fields Scenario: Running an 'ofType' = time request should be successful Given there is a non nullable field foo And foo is equal to T09:15:00.000Z diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature index 5d7db472a..66766acb0 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeFinancialCodes.feature @@ -14,7 +14,6 @@ Feature: User can specify that a field must be a financial code type Scenario: Sequential isins are generated uniquely Given foo has type "ISIN" - And the generator can generate at most 4 rows Then the following data should be generated: | foo | @@ -68,30 +67,26 @@ Feature: User can specify that a field must be a financial code type Scenario: A RIC constraint combined with a not null constraint generates valid RICs Given foo has type "RIC" - And foo is in set: - | "AB.PQ" | + | "AB.PQ" | Then the following data should be generated: - | foo | - | "AB.PQ" | + | foo | + | "AB.PQ" | Scenario: A RIC constraint combined with a not null constraint and an in set constraint that does not contain any valid RICs generates no data Given foo has type "RIC" - And foo is in set: - | "NOPE" | + | "NOPE" | Then the following data should be generated: - | foo | + | foo | Scenario: A RIC constraint combined with an of length constraint returns valid RICs of the specified length Given foo has type "RIC" - And foo is of length 6 And foo is in set: - | "AB.PQ" | - | "ABC.PQ" | - | "ABCD.PQ" | + | "AB.PQ" | + | "ABC.PQ" | + | "ABCD.PQ" | Then the following data should be generated: - | foo | - | "ABC.PQ" | - + | foo | + | "ABC.PQ" | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeNames.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeNames.feature index d31b4937a..13b646bb0 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeNames.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/general/OfTypeNames.feature @@ -5,7 +5,6 @@ Feature: User can specify that a field must be a type of name And there is a non nullable field foo And foo has type "string" - Scenario: Generating with an of type firstname constraint generates valid firstnames Given foo has type "firstname" And the generator can generate at most 10 rows diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AllOf.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AllOf.feature index 9e1c1f92b..1532f9e50 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AllOf.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AllOf.feature @@ -7,8 +7,8 @@ Feature: User can specify that data must be created to conform to each of multip Given there is a non nullable field foo And All Of the next 2 constraints And All Of the next 2 constraints - And foo is matching regex /[a-b]{2}/ - And foo is of length 2 + And foo is matching regex /[a-b]{2}/ + And foo is of length 2 And foo is shorter than 3 And foo has type "string" Then the following data should be generated: @@ -23,11 +23,11 @@ Feature: User can specify that data must be created to conform to each of multip And foo has type "string" And All Of the next 2 constraints And All Of the next 2 constraints - And foo is matching regex /[a-k]{3}/ - And foo is matching regex /[1-5]{3}/ + And foo is matching regex /[a-k]{3}/ + And foo is matching regex /[1-5]{3}/ And foo is longer than 4 Then the following data should be generated: - | foo | + | foo | Scenario: Running a 'allOf' request that includes multiple values within the same statement should be successful Given there is a non nullable field foo diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AnyOf.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AnyOf.feature index 33d51e164..ac5a41858 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AnyOf.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/AnyOf.feature @@ -15,7 +15,6 @@ Feature: Values can be specified by using any of to set multiple constraints | "Test5" | And foo is matching regex /[a-b]{4}/ And foo has type "string" - Then the following data should be generated: | foo | | "Test0" | @@ -43,14 +42,14 @@ Feature: Values can be specified by using any of to set multiple constraints Scenario: When user requires creation of a field with strings that contain multiple contradictory sets of one or many constraints no data should be generated Given Any Of the next 3 constraints - And foo is equal to "Test0" - And foo is in set: - | "Test1" | - | "Test2" | - | "Test3" | - | "Test4" | - | "Test5" | - And foo is matching regex /[a-b]{4}/ + And foo is equal to "Test0" + And foo is in set: + | "Test1" | + | "Test2" | + | "Test3" | + | "Test4" | + | "Test5" | + And foo is matching regex /[a-b]{4}/ And Any Of the next 2 constraints And foo is equal to "Test6" And foo is in set: @@ -58,15 +57,14 @@ Feature: Values can be specified by using any of to set multiple constraints | "Test8" | | "Test9" | And foo has type "string" - Then no data is created Scenario: Running an 'anyOf' request that contains a valid nested anyOf request should be successful Given Any Of the next 2 constraints And foo is of length 1 And Any Of the next 2 constraints - And foo is of length 3 - And foo is of length 5 + And foo is of length 3 + And foo is of length 5 And foo is in set: | "1" | | "22" | @@ -74,7 +72,6 @@ Feature: Values can be specified by using any of to set multiple constraints | "4444" | | "55555" | And foo has type "string" - Then the following data should be generated: | foo | | "1" | @@ -87,9 +84,9 @@ Feature: Values can be specified by using any of to set multiple constraints Scenario: Running an 'anyOf' request that contains a valid nested allOf request should be successful Given Any Of the next 2 constraints And foo is of length 1 - And All Of the next 2 constraints - And foo is longer than 3 - And foo is shorter than 5 + And All Of the next 2 constraints + And foo is longer than 3 + And foo is shorter than 5 And foo is in set: | "1" | | "22" | @@ -97,7 +94,6 @@ Feature: Values can be specified by using any of to set multiple constraints | "4444" | | "55555" | And foo has type "string" - Then the following data should be generated: | foo | | "1" | @@ -111,9 +107,8 @@ Feature: Values can be specified by using any of to set multiple constraints Given Any Of the next 2 constraints And foo is of length 1 And Any Of the next 1 constraints - And foo is of length -1 + And foo is of length -1 And foo has type "string" - Then the profile is invalid because "String length must have a value >= 0, currently is -1" And no data is created @@ -121,9 +116,8 @@ Feature: Values can be specified by using any of to set multiple constraints Given Any Of the next 2 constraints And foo is of length 1 And All Of the next 1 constraints - And foo is of length -1 + And foo is of length -1 And foo has type "string" - Then the profile is invalid because "String length must have a value >= 0, currently is -1" And no data is created @@ -131,8 +125,8 @@ Feature: Values can be specified by using any of to set multiple constraints Given Any Of the next 2 constraints And foo is of length 1 And All Of the next 2 constraints - And foo is longer than 3 - And foo is shorter than 2 + And foo is longer than 3 + And foo is shorter than 2 And foo has type "string" And foo is in set: | "a" | @@ -140,7 +134,6 @@ Feature: Values can be specified by using any of to set multiple constraints | "9" | | "a1" | | "B" | - Then the following data should be generated: | foo | | "a" | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature index 2002eef77..7538462d6 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/grammatical/If.feature @@ -57,8 +57,8 @@ Feature: Values can be specified by using if, then and else constraints And bar has type "string" When If Then and Else are described below And Any Of the next 2 constraints - And foo is equal to 1 - And foo is equal to 2 + And foo is equal to 1 + And foo is equal to 2 And bar is equal to "a" And bar is equal to "b" Then the following data should be generated: @@ -80,11 +80,10 @@ Feature: Values can be specified by using if, then and else constraints | "b" | And foo has type "decimal" And bar has type "string" - When If Then and Else are described below And All Of the next 2 constraints - And foo is greater than 1 - And foo is less than 4 + And foo is greater than 1 + And foo is less than 4 And bar is equal to "a" And bar is equal to "b" Then the following data should be generated: @@ -106,7 +105,6 @@ Feature: Values can be specified by using if, then and else constraints | "b" | And foo has type "decimal" And bar has type "string" - When If Then and Else are described below And foo is anything but equal to 1 And bar is equal to "a" @@ -131,13 +129,12 @@ Feature: Values can be specified by using if, then and else constraints | "c" | And foo has type "decimal" And bar has type "string" - When If Then and Else are described below And foo is greater than 1 - When If Then and Else are described below - And foo is greater than 3 - And bar is equal to "a" - And bar is equal to "b" + When If Then and Else are described below + And foo is greater than 3 + And bar is equal to "a" + And bar is equal to "b" And bar is equal to "c" Then the following data should be generated: | foo | bar | @@ -159,7 +156,6 @@ Feature: Values can be specified by using if, then and else constraints | "c" | And foo has type "decimal" And bar has type "string" - When If Then and Else are described below And foo is equal to 5 And bar is equal to "a" @@ -184,7 +180,6 @@ Feature: Values can be specified by using if, then and else constraints | "c" | And foo has type "decimal" And bar has type "string" - When If Then and Else are described below And foo is equal to 1 And bar is equal to "X" @@ -201,14 +196,12 @@ Feature: Values can be specified by using if, then and else constraints | 2 | | 3 | | 4 | - And bar is in set: | "a" | | "b" | | "c" | And foo has type "decimal" And bar has type "string" - When If Then and Else are described below And foo is equal to 1 And bar is equal to "a" @@ -230,7 +223,6 @@ Feature: Values can be specified by using if, then and else constraints | "c" | And foo has type "decimal" And bar has type "string" - When If Then and Else are described below And foo is in set: | 1 | @@ -315,7 +307,6 @@ Feature: Values can be specified by using if, then and else constraints | "c" | And foo has type "decimal" And bar has type "string" - When If Then and Else are described below And foo is in set: | 8 | @@ -368,11 +359,11 @@ Feature: Values can be specified by using if, then and else constraints And bar is equal to "b" And bar is equal to "c" Then the following data should be generated: - | foo | bar | - | null | "b" | - | 2 | "c" | - | 3 | "c" | - | 4 | "c" | + | foo | bar | + | null | "b" | + | 2 | "c" | + | 3 | "c" | + | 4 | "c" | Scenario: Running an if request that contains a non contradictory null constraint within its then statement should be successful Given foo is in set: @@ -427,7 +418,6 @@ Feature: Values can be specified by using if, then and else constraints | "a" | | "b" | | "c" | - And foo has type "decimal" And bar has type "string" When If Then and Else are described below @@ -499,7 +489,6 @@ Feature: Values can be specified by using if, then and else constraints | "20" | | "AA" | | "BB" | - And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -583,7 +572,6 @@ Feature: Values can be specified by using if, then and else constraints | "20" | | "AA" | | "BB" | - When If Then and Else are described below And foo is matching regex /[0-9]{2}/ And bar is equal to "AA" @@ -655,7 +643,6 @@ Feature: Values can be specified by using if, then and else constraints | "20" | | "AA" | | "BB" | - And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -737,7 +724,6 @@ Feature: Values can be specified by using if, then and else constraints | "20" | | "AA" | | "BB" | - And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -786,7 +772,6 @@ Feature: Values can be specified by using if, then and else constraints | "22" | | "333" | | "4444" | - And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -864,7 +849,6 @@ Feature: Values can be specified by using if, then and else constraints | "22" | | "333" | | "4444" | - And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -938,7 +922,6 @@ Feature: Values can be specified by using if, then and else constraints | "22" | | "333" | | "4444" | - And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -1020,7 +1003,6 @@ Feature: Values can be specified by using if, then and else constraints | "22" | | "333" | | "4444" | - And foo has type "string" And bar has type "string" When If Then and Else are described below @@ -1153,7 +1135,6 @@ Feature: Values can be specified by using if, then and else constraints | 22 | | 333 | | 4444 | - And foo has type "decimal" And bar has type "decimal" When If Then and Else are described below @@ -1284,7 +1265,6 @@ Feature: Values can be specified by using if, then and else constraints | 22 | | 333 | | 4444 | - And foo has type "decimal" And bar has type "decimal" When If Then and Else are described below @@ -1418,7 +1398,6 @@ Feature: Values can be specified by using if, then and else constraints | 22 | | 333 | | 4444 | - And foo has type "decimal" And bar has type "decimal" When If Then and Else are described below @@ -1551,7 +1530,6 @@ Feature: Values can be specified by using if, then and else constraints | 22 | | 333 | | 4444 | - When If Then and Else are described below And foo is less than or equal to 20 And bar is equal to 1 @@ -1760,7 +1738,6 @@ Feature: Values can be specified by using if, then and else constraints | 2010-01-03T00:00:00.000Z | | 2010-01-04T00:00:00.000Z | | 2010-01-05T00:00:00.000Z | - And foo has type "datetime" And bar has type "datetime" When If Then and Else are described below @@ -1909,7 +1886,6 @@ Feature: Values can be specified by using if, then and else constraints | 2010-01-03T00:00:00.000Z | | 2010-01-04T00:00:00.000Z | | 2010-01-05T00:00:00.000Z | - And foo has type "datetime" And bar has type "datetime" When If Then and Else are described below @@ -2219,7 +2195,6 @@ Feature: Values can be specified by using if, then and else constraints | 2010-01-03T00:00:00.000Z | | 2010-01-04T00:00:00.000Z | | 2010-01-05T00:00:00.000Z | - And foo has type "datetime" And bar has type "datetime" When If Then and Else are described below @@ -2480,13 +2455,12 @@ Feature: Values can be specified by using if, then and else constraints | 30 | | 40 | | 50 | - And foo has type "string" And bar has type "decimal" When If Then and Else are described below And Any Of the next 2 constraints - And foo is equal to "a" - And foo is equal to "e" + And foo is equal to "a" + And foo is equal to "e" And bar is equal to 10 And bar is equal to 50 Then the following data should be generated: @@ -2511,15 +2485,14 @@ Feature: Values can be specified by using if, then and else constraints | 30 | | 40 | | 50 | - And foo has type "string" And bar has type "decimal" When If Then and Else are described below And foo is equal to "a" And bar is equal to 10 And Any Of the next 2 constraints - And bar is equal to 20 - And bar is equal to 40 + And bar is equal to 20 + And bar is equal to 40 Then the following data should be generated: | foo | bar | | "a" | 10 | @@ -2546,14 +2519,13 @@ Feature: Values can be specified by using if, then and else constraints | 30 | | 40 | | 50 | - And foo has type "string" And bar has type "decimal" When If Then and Else are described below And foo is equal to "a" And Any Of the next 2 constraints - And bar is equal to 1 - And bar is equal to 2 + And bar is equal to 1 + And bar is equal to 2 And bar is equal to 50 Then the following data should be generated: | foo | bar | @@ -2569,22 +2541,20 @@ Feature: Values can be specified by using if, then and else constraints | "c" | | "d" | | "e" | - And bar is in set: | 10 | | 20 | | 30 | | 40 | | 50 | - And foo has type "string" And bar has type "decimal" When If Then and Else are described below And foo is equal to "a" And bar is equal to 10 And Any Of the next 2 constraints - And bar is equal to 1 - And bar is equal to 2 + And bar is equal to 1 + And bar is equal to 2 Then the following data should be generated: | foo | bar | | "a" | 10 | @@ -2603,13 +2573,12 @@ Feature: Values can be specified by using if, then and else constraints | 333 | | 4444 | | 55555 | - And foo has type "string" And bar has type "decimal" When If Then and Else are described below And All Of the next 2 constraints - And foo is longer than 0 - And foo is shorter than 2 + And foo is longer than 0 + And foo is shorter than 2 And bar is equal to 1 And bar is equal to 55555 Then the following data should be generated: @@ -2640,8 +2609,8 @@ Feature: Values can be specified by using if, then and else constraints When If Then and Else are described below And foo is equal to "a" And All Of the next 2 constraints - And bar is greater than 200 - And bar is less than 300 + And bar is greater than 200 + And bar is less than 300 And bar is equal to 55555 Then the following data should be generated: | foo | bar | @@ -2672,8 +2641,8 @@ Feature: Values can be specified by using if, then and else constraints And foo is equal to "a" And bar is equal to 1 And All Of the next 2 constraints - And bar is greater than 200 - And bar is less than 300 + And bar is greater than 200 + And bar is less than 300 Then the following data should be generated: | foo | bar | | "a" | 1 | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature index a5bc0735d..96460f26e 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/FieldDependencies.feature @@ -1,6 +1,6 @@ Feature:As a User - I can specify that a numeric value is greater than, less than or equal to a numeric value in a different field - So that I can setup the test data to meet my requirements + I can specify that a numeric value is greater than, less than or equal to a numeric value in a different field + So that I can setup the test data to meet my requirements Background: Given the generation strategy is full @@ -8,12 +8,8 @@ Feature:As a User And there is a non nullable field foo And foo has type "integer" And foo is greater than 0 - And there is a non nullable field bar And bar has type "integer" - - - ###Integer Scenario: The one where a user can specify that one number should be greater than another number Given bar is greater than 0 @@ -21,10 +17,10 @@ Feature:As a User And the generator can generate at most 5 rows And bar is greater than field foo Then the following data should be generated: - | foo| bar| - | 1 | 2 | - | 1 | 3 | - | 2 | 3 | + | foo | bar | + | 1 | 2 | + | 1 | 3 | + | 2 | 3 | Scenario: The one where a user can specify that one number should be greater than or equal to another number Given bar is greater than 0 @@ -32,12 +28,12 @@ Feature:As a User And the generator can generate at most 5 rows And bar is greater than or equal to field foo Then the following data should be generated: - | foo| bar| - | 1 | 1 | - | 1 | 2 | - | 1 | 3 | - | 2 | 2 | - | 2 | 3 | + | foo | bar | + | 1 | 1 | + | 1 | 2 | + | 1 | 3 | + | 2 | 2 | + | 2 | 3 | Scenario: The one where a user can specify that one number should be less than another number Given foo is less than 3 @@ -45,8 +41,8 @@ Feature:As a User And the generator can generate at most 3 rows And bar is less than field foo Then the following data should be generated: - | foo| bar| - | 2 | 1 | + | foo | bar | + | 2 | 1 | Scenario: The one where a user can specify that one number should be less than or equal to another number Given the combination strategy is exhaustive @@ -54,20 +50,20 @@ Feature:As a User And bar is greater than 0 And bar is less than or equal to field foo Then the following data should be generated: - | foo| bar| - | 1 | 1 | - | 2 | 1 | - | 2 | 2 | + | foo | bar | + | 1 | 1 | + | 2 | 1 | + | 2 | 2 | Scenario: The one where a user can specify that one number should be equal to another number Given bar is greater than 0 And the generator can generate at most 3 rows And bar is equal to field foo Then the following data should be generated: - | foo| bar| - | 1 | 1 | - | 2 | 2 | - | 3 | 3 | + | foo | bar | + | 1 | 1 | + | 2 | 2 | + | 3 | 3 | Scenario: The one where a user can specify that one number should be equal to another number with a positive offset Given bar is greater than 0 @@ -82,10 +78,10 @@ Feature:As a User } """ Then the following data should be generated: - | foo| bar| - | 1 | 4 | - | 2 | 5 | - | 3 | 6 | + | foo | bar | + | 1 | 4 | + | 2 | 5 | + | 3 | 6 | Scenario: The one where a user can specify that one number should be equal to another number with a negative offset Given the generator can generate at most 3 rows @@ -99,10 +95,10 @@ Feature:As a User } """ Then the following data should be generated: - | foo| bar| - | 1 | -2 | - | 2 | -1 | - | 3 | 0 | + | foo | bar | + | 1 | -2 | + | 2 | -1 | + | 3 | 0 | @ignore #pending development of #1235 - Allow a Numeric Field to Depend On Another Numeric Field Scenario: The one where a user can specify that one number should be greater than another number with a positive offset @@ -119,10 +115,10 @@ Feature:As a User } """ Then the following data should be generated: - | foo| bar| - | 1 | 4 | - | 2 | 5 | - | 3 | 6 | + | foo | bar | + | 1 | 4 | + | 2 | 5 | + | 3 | 6 | @ignore #pending development of #1235 - Allow a Numeric Field to Depend On Another Numeric Field Scenario: The one where a user can specify that one number should be less than another number with a negative offset @@ -138,13 +134,11 @@ Feature:As a User } """ Then the following data should be generated: - | foo| bar| - | 1 | -2 | - | 2 | -1 | - | 3 | 0 | - + | foo | bar | + | 1 | -2 | + | 2 | -1 | + | 3 | 0 | ###Exhaustive - Scenario: The one where a user can specify that one number should be greater than another number - exhaustive Given the combination strategy is exhaustive And bar is greater than 0 @@ -152,11 +146,10 @@ Feature:As a User And the generator can generate at most 6 rows And bar is greater than field foo Then the following data should be generated: - | foo| bar| - | 1 | 2 | - | 1 | 3 | - | 1 | 4 | - | 2 | 3 | - | 2 | 4 | - | 3 | 4 | - + | foo | bar | + | 1 | 2 | + | 1 | 3 | + | 1 | 4 | + | 2 | 3 | + | 2 | 4 | + | 3 | 4 | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GranularTo-Decimal.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GranularTo-Decimal.feature index 164512279..d80988fce 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GranularTo-Decimal.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GranularTo-Decimal.feature @@ -3,7 +3,6 @@ Feature: User can specify that decimal fields are granular to a certain number o Background: Given the generation strategy is full And there is a non nullable field foo - And foo has type "decimal" Scenario: User requires to create a numeric field with data values that include a decimal value to one decimal point @@ -30,7 +29,7 @@ Feature: User can specify that decimal fields are granular to a certain number o And foo is greater than or equal to -1 Then the following data should be generated: | foo | - | 0 | + | 0 | | -0.1 | | -0.2 | | -0.3 | @@ -67,15 +66,11 @@ Feature: User can specify that decimal fields are granular to a certain number o | 3 | | 4 | | 5 | - ### related field - Scenario: The one where a user can specify that one decimal number should be greater than another decimal number Given foo is granular to 0.1 And the combination strategy is exhaustive And foo is greater than or equal to 1 - - And there is a non nullable field bar And bar has type "decimal" And bar is granular to 0.1 diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature index 30eeedded..17ba55a14 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThan.feature @@ -3,13 +3,10 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Background: Given the generation strategy is full And there is a nullable field foo - ###Integer - Scenario: Running a 'greaterThan' request that specifies an integer should be successful Given foo has type "integer" And foo is greater than 1 - And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -22,7 +19,6 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that specifies an integer with trailing zeros should be successful Given foo is greater than 100 And foo has type "integer" - And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -34,7 +30,6 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that specifies a decimal should be successful Given foo is greater than 100 - And foo has type "decimal" And the generator can generate at most 5 rows Then the following data should be generated: @@ -47,7 +42,6 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that specifies a decimal with trailing zeros should be successful Given foo is greater than 100.0 - And foo has type "decimal" And the generator can generate at most 5 rows Then the following data should be generated: @@ -61,7 +55,6 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that specifies a negative should be successful for type integer Given foo is greater than -100 And foo has type "integer" - And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -74,7 +67,6 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that specifies a negative should be successful for type decimal Given foo is greater than -100 And foo has type "decimal" - And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -87,7 +79,6 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that includes the value zero should be successful for type integer Given foo is greater than -1 And foo has type "integer" - And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -100,7 +91,6 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: Running a 'greaterThan' request that includes the value zero should be successful for type decimal Given foo is greater than -0.00000000000000000001 And foo has type "decimal" - And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -109,13 +99,11 @@ Feature: User can specify that a numeric value is higher than, but not equal to, | 0.00000000000000000002 | | 0.00000000000000000003 | | 0.00000000000000000004 | - #greaterThan Scenario: greaterThan run against a non contradicting greaterThan should be successful (greaterThan 2 AND greaterThan 1) Given foo is greater than 2 And foo is greater than 1 And foo has type "integer" - And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -144,12 +132,10 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Then the following data should be generated: | foo | | null | - #greaterThanOrEqualTo Scenario: greaterThan run against a non contradicting greaterThanOrEqualTo should be successful (greaterThan 2 AND greaterThanOrEqualTo 1) Given foo is greater than 2 And foo is greater than or equal to 1 - And foo has type "integer" And the generator can generate at most 5 rows Then the following data should be generated: @@ -178,7 +164,6 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Then the following data should be generated: | foo | | null | - #lessThan Scenario: greaterThan run against a non contradicting lessThan should be successful (greaterThan 2 AND lessThan 5) Given foo is greater than 2 @@ -193,7 +178,6 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Scenario: greaterThan run against a non contradicting not lessThan should be successful (greaterThan 1 AND not lessThan 2) Given foo is greater than 1 And foo is anything but less than 2 - And foo has type "integer" And the generator can generate at most 5 rows Then the following data should be generated: @@ -230,7 +214,6 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Then the following data should be generated: | foo | | 2 | - #lessThanOrEqualTo Scenario: greaterThan run against a non contradicting lessThanOrEqualTo should be successful (greaterThan 2 AND lessThanOrEqualTo 5) Given foo is greater than 2 @@ -247,7 +230,6 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Given foo is greater than 1 And foo is anything but less than or equal to 2 And foo has type "integer" - And the generator can generate at most 5 rows Then the following data should be generated: | foo | @@ -283,13 +265,10 @@ Feature: User can specify that a numeric value is higher than, but not equal to, Then the following data should be generated: | foo | | 2 | - - #granularTo Scenario: greaterThan run against a non contradicting granularTo should be successful (greaterThan 2 AND granularTo 0.1) Given foo is greater than 2 And foo is granular to 0.1 - And foo has type "decimal" And the generator can generate at most 5 rows Then the following data should be generated: @@ -299,4 +278,3 @@ Feature: User can specify that a numeric value is higher than, but not equal to, | 2.3 | | 2.4 | | 2.5 | - diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature index 80c8e90b1..e9d2447d0 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/GreaterThanOrEqualTo.feature @@ -7,7 +7,6 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Scenario: Running a 'greaterThanOrEqualTo' request that includes a positive integer should be successful Given foo is greater than or equal to 0 And the generator can generate at most 5 rows - And foo has type "integer" Then the following data should be generated: | foo | @@ -20,7 +19,6 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Scenario: Running a 'greaterThanOrEqualTo' request that includes positive decimal should be successful Given foo is greater than or equal to 0.0 And the generator can generate at most 5 rows - And foo has type "decimal" Then the following data should be generated: | foo | @@ -30,11 +28,9 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp | 0.00000000000000000003 | | 0.00000000000000000004 | - Scenario: Running a 'greaterThanOrEqualTo' request that includes a negative integer should be successful Given foo is greater than or equal to -10 And the generator can generate at most 5 rows - And foo has type "integer" Then the following data should be generated: | foo | @@ -47,7 +43,6 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Scenario: Running a 'greaterThanOrEqualTo' request that includes 0 should be successful Given foo is greater than or equal to 0 And the generator can generate at most 5 rows - And foo has type "integer" Then the following data should be generated: | foo | @@ -61,7 +56,6 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Given foo is greater than or equal to 5 And foo is greater than or equal to 5 And the generator can generate at most 5 rows - And foo has type "integer" Then the following data should be generated: | foo | @@ -110,7 +104,6 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Given foo is greater than or equal to 5 And foo is anything but less than 10 And the generator can generate at most 5 rows - And foo has type "integer" Then the following data should be generated: | foo | @@ -167,7 +160,6 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp Given foo is greater than or equal to 5 And foo is anything but less than or equal to 5 And the generator can generate at most 5 rows - And foo has type "integer" Then the following data should be generated: | foo | @@ -211,7 +203,6 @@ Feature: User can specify that a numeric value is higher than, or equal to, a sp And foo is granular to 1 And foo has type "integer" And the generator can generate at most 5 rows - Then the following data should be generated: | foo | | 9 | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature index 84be54bb0..fda66f2fa 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThan.feature @@ -31,7 +31,6 @@ Feature: User can specify that a numeric value is lower than, but not equal to, Scenario: not lessThan run against a non contradicting not lessThan should be successful (not lessThan 5 AND not lessThan 5) Given foo is anything but less than 5 And foo is anything but less than 5 - And foo has type "integer" And the generator can generate at most 5 rows Then the following data should be generated: @@ -85,7 +84,6 @@ Feature: User can specify that a numeric value is lower than, but not equal to, Scenario: not lessThan run against a non contradicting not lessThanOrEqualTo should be successful (not lessThan 3 AND not lessThanOrEqualTo 4) Given foo is anything but less than 3 And foo is anything but less than or equal to 4 - And foo has type "integer" And the generator can generate at most 5 rows Then the following data should be generated: @@ -107,7 +105,6 @@ Feature: User can specify that a numeric value is lower than, but not equal to, Scenario: not lessThan run against a non contradicting granularTo should be successful (not lessThan 4 AND granularTo 1) Given foo is anything but less than 4 And foo is granular to 1 - And foo has type "decimal" And the generator can generate at most 5 rows Then the following data should be generated: @@ -117,4 +114,3 @@ Feature: User can specify that a numeric value is lower than, but not equal to, | 6 | | 7 | | 8 | - diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature index 34c7350cc..fb19e75d4 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/numeric/LessThanOrEqualTo.feature @@ -19,7 +19,6 @@ Feature: User can specify that a numeric value is lower than, or equal to, a spe And foo is anything but less than or equal to 3 And foo has type "integer" And the generator can generate at most 5 rows - Then the following data should be generated: | foo | | 4 | @@ -41,7 +40,6 @@ Feature: User can specify that a numeric value is lower than, or equal to, a spe And the generator can generate at most 5 rows And foo has type "decimal" And foo is granular to 1 - Then the following data should be generated: | foo | | 4 | @@ -49,4 +47,3 @@ Feature: User can specify that a numeric value is lower than, or equal to, a spe | 6 | | 7 | | 8 | - diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/CharacterSet.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/CharacterSet.feature index d2387e548..4c79d4b48 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/CharacterSet.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/CharacterSet.feature @@ -101,6 +101,6 @@ Feature: Strings will be generated using characters from only latin characters | "y" | | "z" | | "{" | - | "\|" | + | "\|" | | "}" | | "~" | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature index 990497452..24f8f2f00 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/LongerThan.feature @@ -45,7 +45,6 @@ Feature: User can specify that a string length is longer than, a specified numbe | "aaa" | | "aab" | - Scenario: Valid 'longerThan' and not 'longerThan' requests should be successful Given foo is longer than 1 And foo is anything but longer than 3 @@ -244,7 +243,6 @@ Feature: User can specify that a string length is longer than, a specified numbe Given foo is longer than 999 And the generation strategy is random And the generator can generate at most 1 rows - Then foo contains strings of length between 1000 and 1000 inclusively Scenario: longerThan with value larger than maximum permitted should fail with an error message diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex-SpecialChars.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex-SpecialChars.feature index 25fc3be4c..f517512a2 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex-SpecialChars.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex-SpecialChars.feature @@ -1,4 +1,3 @@ - Feature: Whilst including non-latin characters, user can specify that a value either matches or contains a specified regex Background: @@ -9,5 +8,5 @@ Feature: Whilst including non-latin characters, user can specify that a value ei Scenario: Running a 'matchingRegex' request that includes special characters (emoji) only should be successful Given foo is matching regex /[😁-😘]{1}/ Then the following data should be generated: - | foo | + | foo | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature index 53dcd8463..30b5d2821 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/MatchingRegex.feature @@ -8,98 +8,98 @@ Feature: User can specify that a value either matches or contains a specified re Scenario: Running a 'matchingRegex' request that includes roman alphabet lowercase chars (a-z) only should be successful Given foo is matching regex /[a-z]{1}/ Then the following data should be generated: - | foo | - | "a" | - | "b" | - | "c" | - | "d" | - | "e" | - | "f" | - | "g" | - | "h" | - | "i" | - | "j" | - | "k" | - | "l" | - | "m" | - | "n" | - | "o" | - | "p" | - | "q" | - | "r" | - | "s" | - | "t" | - | "u" | - | "v" | - | "w" | - | "x" | - | "y" | - | "z" | + | foo | + | "a" | + | "b" | + | "c" | + | "d" | + | "e" | + | "f" | + | "g" | + | "h" | + | "i" | + | "j" | + | "k" | + | "l" | + | "m" | + | "n" | + | "o" | + | "p" | + | "q" | + | "r" | + | "s" | + | "t" | + | "u" | + | "v" | + | "w" | + | "x" | + | "y" | + | "z" | Scenario: Running a 'matchingRegex' request that includes roman alphabet uppercase chars (A-Z) only should be successful Given foo is matching regex /[A-Z]{1}/ Then the following data should be generated: - | foo | - | "A" | - | "B" | - | "C" | - | "D" | - | "E" | - | "F" | - | "G" | - | "H" | - | "I" | - | "J" | - | "K" | - | "L" | - | "M" | - | "N" | - | "O" | - | "P" | - | "Q" | - | "R" | - | "S" | - | "T" | - | "U" | - | "V" | - | "W" | - | "X" | - | "Y" | - | "Z" | + | foo | + | "A" | + | "B" | + | "C" | + | "D" | + | "E" | + | "F" | + | "G" | + | "H" | + | "I" | + | "J" | + | "K" | + | "L" | + | "M" | + | "N" | + | "O" | + | "P" | + | "Q" | + | "R" | + | "S" | + | "T" | + | "U" | + | "V" | + | "W" | + | "X" | + | "Y" | + | "Z" | Scenario: Running a 'matchingRegex' request that includes roman numeric chars (0-9) only should be successful Given foo is matching regex /[0-9]{1}/ Then the following data should be generated: - | foo | - | "0" | - | "1" | - | "2" | - | "3" | - | "4" | - | "5" | - | "6" | - | "7" | - | "8" | - | "9" | + | foo | + | "0" | + | "1" | + | "2" | + | "3" | + | "4" | + | "5" | + | "6" | + | "7" | + | "8" | + | "9" | Scenario: Running a 'matchingRegex' request that includes basic punctuation characters (!-.) only should be successful Given foo is matching regex /[!-.]{1}/ Then the following data should be generated: - | foo | - | "!" | - | """ | - | "#" | - | "$" | - | "%" | - | "&" | - | "'" | - | "(" | - | ")" | - | "*" | - | "+" | - | "," | - | "-" | - | "." | + | foo | + | "!" | + | """ | + | "#" | + | "$" | + | "%" | + | "&" | + | "'" | + | "(" | + | ")" | + | "*" | + | "+" | + | "," | + | "-" | + | "." | Scenario: Running a 'matchingRegex' request that includes special characters (non roman character maps: Hiragana) should be successful Given foo is matching regex /[あ-げ]{1}/ @@ -154,21 +154,21 @@ Feature: User can specify that a value either matches or contains a specified re Scenario: Running a 'matchingRegex' request for a single character (a) should be successful Given foo is matching regex /[a]{1}/ Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: Running a 'matchingRegex' request for a range over a single character ([a-a]) should be successful Given foo is matching regex /[a-a]{1}/ Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: Running a 'matchingRegex' for a minimum length of 0 should be successful Given foo is matching regex /[a]{0,1}/ Then the following data should be generated: - | foo | - | "" | - | "a" | + | foo | + | "" | + | "a" | Scenario: Running a 'matchingRegex' for a maximum length smaller than the minimum length should fail with an error Given foo is matching regex /[a]{1,0}/ @@ -199,7 +199,6 @@ Feature: User can specify that a value either matches or contains a specified re Scenario: User using matchingRegex operator to provide an exact set of values Given foo is matching regex /[a]{1,3}/ - Then the following data should be generated: | foo | | "a" | @@ -217,8 +216,8 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /[a]{1}/ And foo is anything but matching regex /[b]{2}/ Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: Running a 'matchingRegex' request alongside a contradicting matchingRegex constraint should generate null Given foo is matching regex /[a]{1}/ @@ -246,16 +245,16 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /[a]{1}/ And foo is anything but containing regex /[7]{1}/ Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: matchingRegex run against a non contradicting not containingRegex should be successful Given foo is anything but matching regex /[a]{1}/ And foo is containing regex /[7]{1}/ And foo is of length 1 Then the following data should be generated: - | foo | - | "7" | + | foo | + | "7" | Scenario: Running a 'matchingRegex' request alongside a contradicting containingRegex constraint should generate null Given foo is matching regex /[b]{3}/ @@ -283,8 +282,8 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /[a]{1}/ And foo is anything but of length 5 Then the following data should be generated: - | foo | - | "a" | + | foo | + | "a" | Scenario: not matchingRegex run against a non contradicting ofLength should be successful Given foo is matching regex /[a-z]{1}/ @@ -292,11 +291,11 @@ Feature: User can specify that a value either matches or contains a specified re And foo is of length 1 And the generator can generate at most 4 rows Then the following data should be generated: - | foo | - | "b" | - | "c" | - | "d" | - | "e" | + | foo | + | "b" | + | "c" | + | "d" | + | "e" | Scenario: matchingRegex run against a contradicting ofLength should only generate null Given foo is matching regex /[b]{2}/ @@ -343,8 +342,8 @@ Feature: User can specify that a value either matches or contains a specified re Given foo is matching regex /[b]{1}/ And foo is shorter than 2 Then the following data should be generated: - | foo | - | "b" | + | foo | + | "b" | Scenario: matchingRegex run against a non contradicting not shorterThan should be successful Given foo is matching regex /[b]{2}/ @@ -359,11 +358,11 @@ Feature: User can specify that a value either matches or contains a specified re And foo is shorter than 2 And the generator can generate at most 4 rows Then the following data should be generated: - | foo | - | "a" | - | "c" | - | "d" | - | "e" | + | foo | + | "a" | + | "c" | + | "d" | + | "e" | Scenario: matchingRegex run against a contradicting shorterThan should only generate null Given foo is matching regex /[b]{2}/ @@ -388,8 +387,8 @@ Feature: User can specify that a value either matches or contains a specified re And lee is less than 2 And lee is greater than 0 Then the following data should be generated: - | foo | bar | lee | - | "a" | "AA" | 1 | - | "a" | "AA" | null | - | "a" | null | 1 | - | "a" | null | null | + | foo | bar | lee | + | "a" | "AA" | 1 | + | "a" | "AA" | null | + | "a" | null | 1 | + | "a" | null | null | diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature index cd1cb6314..6fd9f1ff7 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/OfLength.feature @@ -60,11 +60,9 @@ Feature: User can specify the length of generated string data using 'ofLength' Then the profile is invalid because "(Couldn't recognise 'value' property, it must be an Integer but was a String with value `.*`)|(Cannot create an StringHasLengthConstraint for field 'foo' with a a negative length.)|(String length must have a value >= 0, currently is -?\d+)" And no data is created Examples: - | length | - | -1 | - + | length | + | -1 | # COMBINATION OF CONSTRAINTS # - Scenario: ofLength run against a non contradicting ofLength should be successful Given foo is of length 1 And foo is of length 1 @@ -235,7 +233,6 @@ Feature: User can specify the length of generated string data using 'ofLength' Given foo is of length 1000 And the generator can generate at most 1 rows And the generation strategy is random - Then foo contains strings of length between 1000 and 1000 inclusively Scenario: ofLength with value larger than maximum permitted should fail with an error message diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature index e9e744996..c501fd5d3 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/string/ShorterThan.feature @@ -65,12 +65,11 @@ Feature: User can specify that a string length is lower than, a specified number | foo | | null | - @ignore #1361 shorter than 1001 not accepted + @ignore #1361 shorter than 1001 not accepted Scenario: shorterThan with maximum permitted value should be successful Given foo is shorter than 1001 And the generation strategy is random And the generator can generate at most 1 rows - Then foo contains strings of length between 0 and 1000 inclusively Scenario: shorterThan with value larger than maximum permitted should fail with an error message diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/AfterOrAt.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/AfterOrAt.feature index 443640b52..f0f222602 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/AfterOrAt.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/AfterOrAt.feature @@ -5,7 +5,6 @@ Feature: User can specify that a datetime date is more than, or the same as, a s And there is a non nullable field foo And foo has type "datetime" - Scenario: User requires to create a datetime field with values that are after or at a specified date Given foo is after or at 2018-01-01T00:00:00.000Z And the generator can generate at most 6 rows diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/BeforeOrAt.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/BeforeOrAt.feature index 1646f207d..a664ee88b 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/BeforeOrAt.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/BeforeOrAt.feature @@ -5,7 +5,6 @@ Feature: User can specify that a datetime date is lower than, or the same as, a And there is a non nullable field foo And foo has type "datetime" - Scenario: Running beforeOrAt request that includes datetime field with date (YYYY-MM-DD) values that has invalid date should fail Given foo is before or at 2019-15-32T00:00:00.000Z And the generator can generate at most 5 rows diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField-Multiple.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField-Multiple.feature index d237c79b5..83eb1f244 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField-Multiple.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField-Multiple.feature @@ -12,9 +12,6 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running a "before" and "after" constraint Given the generator can generate at most 1 rows - - - And foobar is before field bar And foobar is after field foo Then the following data should be generated: @@ -23,9 +20,6 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running a "before" and "equalTo" constraint Given the generator can generate at most 1 rows - - - And foobar is before field bar And foobar is equal to field foo Then the following data should be generated: @@ -34,9 +28,6 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running an "after" and "equalTo" constraint Given the generator can generate at most 1 rows - - - And foobar is after field bar And foobar is equal to field foo Then the following data should be generated: @@ -45,9 +36,6 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running two "after" constraints Given the generator can generate at most 1 rows - - - And foobar is after field bar And foobar is after field foo Then the following data should be generated: @@ -56,9 +44,6 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running two "before" constraints switched other field constraints Given the generator can generate at most 1 rows - - - And bar is before field foobar And foo is before field foobar Then the following data should be generated: @@ -67,9 +52,6 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running two "before" constraints Given the generator can generate at most 1 rows - - - And foobar is before field bar And foobar is before field foo Then the following data should be generated: @@ -78,9 +60,6 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running two "after" switched other field constraints Given the generator can generate at most 1 rows - - - And bar is after field foobar And foo is after field foobar Then the following data should be generated: @@ -89,9 +68,6 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running linked "after" constraint Given the generator can generate at most 1 rows - - - And foobar is after field bar And bar is after field foo Then the following data should be generated: @@ -100,9 +76,6 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running linked "before" constraint Given the generator can generate at most 1 rows - - - And foobar is before field bar And bar is before field foo Then the following data should be generated: @@ -111,9 +84,6 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running linked "before" constraint with lower limit Given the generator can generate at most 1 rows - - - And foobar is before 2019-01-01T00:00:00.000Z And foobar is before field bar And bar is before field foo @@ -123,9 +93,6 @@ Feature: running datetimes related to otherfield datetimes for multiple fields Scenario: Running linked "equalTo" constraint Given the generator can generate at most 1 rows - - - And foobar is equal to field bar And bar is equal to field foo Then the following data should be generated: diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField.feature index 317fbea5a..e0bbc32c5 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/DateTimeOtherField.feature @@ -4,10 +4,8 @@ Feature: running datetimes related to otherfield datetimes Given the generation strategy is full And there is a non nullable field foo And foo has type "datetime" - And there is a non nullable field bar And bar has type "datetime" - And the combination strategy is exhaustive Scenario: Running an "afterField" constraint allows one date to be always later than another @@ -20,7 +18,6 @@ Feature: running datetimes related to otherfield datetimes | 2018-09-01T00:00:00.001Z | 2018-09-01T00:00:00.003Z | | 2018-09-01T00:00:00.002Z | 2018-09-01T00:00:00.003Z | - Scenario: Running an "afterOrAtField" constraint allows one date to be always later than or equal to another Given foo is after 2018-09-01T00:00:00.000Z And bar is before 2018-09-01T00:00:00.004Z @@ -34,7 +31,6 @@ Feature: running datetimes related to otherfield datetimes | 2018-09-01T00:00:00.002Z | 2018-09-01T00:00:00.003Z | | 2018-09-01T00:00:00.003Z | 2018-09-01T00:00:00.003Z | - Scenario: Running a "beforeField" constraint allows one date to be always earlier than another Given the generator can generate at most 3 rows And bar is before 0001-01-01T00:00:00.003Z @@ -45,7 +41,6 @@ Feature: running datetimes related to otherfield datetimes | 0001-01-01T00:00:00.000Z | 0001-01-01T00:00:00.002Z | | 0001-01-01T00:00:00.001Z | 0001-01-01T00:00:00.002Z | - Scenario: Running a "beforeOrAtField" constraint allows one date to be always earlier than or equal to another And bar is before 0001-01-01T00:00:00.003Z And foo is before or at field bar @@ -58,7 +53,6 @@ Feature: running datetimes related to otherfield datetimes | 0001-01-01T00:00:00.001Z | 0001-01-01T00:00:00.002Z | | 0001-01-01T00:00:00.002Z | 0001-01-01T00:00:00.002Z | - Scenario: Running an "equalToField" constraint allows one date to be always equal to another Given foo is equal to 2018-09-01T00:00:00.000Z And the generator can generate at most 1 rows @@ -97,7 +91,6 @@ Feature: running datetimes related to otherfield datetimes Then the following data should be generated: | foo | bar | | 2018-01-04T00:00:00.001Z | 2018-01-07T00:00:00.001Z | - # Results accomodate for the fact that the 5 working days include non-working days Scenario: Running an "equalToField" constraint allows one date to be always equal to another plus a value in working days Given the generator can generate at most 1 rows @@ -113,7 +106,6 @@ Feature: running datetimes related to otherfield datetimes Then the following data should be generated: | foo | bar | | 0001-01-01T00:00:00.000Z | 0001-01-08T00:00:00.000Z | - # Results accomodate for the fact that the 5 working days include non-working days Scenario: Running an "equalToField" constraint allows one date to be always equal to another minus a value in working days Given the generator can generate at most 1 rows @@ -130,4 +122,3 @@ Feature: running datetimes related to otherfield datetimes Then the following data should be generated: | foo | bar | | 0001-01-01T00:00:00.000Z | 0001-01-08T00:00:00.000Z | - diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/GranularTo-DateTime.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/GranularTo-DateTime.feature index 7f3b2c9ff..27b0ec654 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/GranularTo-DateTime.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/operators/temporal/GranularTo-DateTime.feature @@ -3,27 +3,24 @@ Feature: User can specify that datetime fields are granular to a certain unit Background: Given the generation strategy is full And there is a non nullable field foo - And foo has type "datetime" - Scenario Outline: User is able to specify supported temporal granularities with after operator Given foo is granular to And foo is after 2000-01-01T00:00:00.000Z And the generator can generate at most 1 rows Then the following data should be generated: - | foo | - | | - + | foo | + | | Examples: - | unit | output | - | "millis" | 2000-01-01T00:00:00.001Z | - | "seconds" | 2000-01-01T00:00:01.000Z | - | "minutes" | 2000-01-01T00:01:00.000Z | - | "hours" | 2000-01-01T01:00:00.000Z | - | "days" | 2000-01-02T00:00:00.000Z | - | "months" | 2000-02-01T00:00:00.000Z | - | "years" | 2001-01-01T00:00:00.000Z | + | unit | output | + | "millis" | 2000-01-01T00:00:00.001Z | + | "seconds" | 2000-01-01T00:00:01.000Z | + | "minutes" | 2000-01-01T00:01:00.000Z | + | "hours" | 2000-01-01T01:00:00.000Z | + | "days" | 2000-01-02T00:00:00.000Z | + | "months" | 2000-02-01T00:00:00.000Z | + | "years" | 2001-01-01T00:00:00.000Z | Scenario Outline: User is able to specify supported temporal granularities with after or at operator Given foo is granular to @@ -31,18 +28,17 @@ Feature: User can specify that datetime fields are granular to a certain unit And the generator can generate at most 2 rows Then the following data should be generated: | foo | - | | - | | - + | | + | | Examples: - | unit | output1 | output2 | - | "millis" | 2000-01-01T00:00:00.000Z | 2000-01-01T00:00:00.001Z | - | "seconds" | 2000-01-01T00:00:00.000Z | 2000-01-01T00:00:01.000Z | - | "minutes" | 2000-01-01T00:00:00.000Z | 2000-01-01T00:01:00.000Z | - | "hours" | 2000-01-01T00:00:00.000Z | 2000-01-01T01:00:00.000Z | - | "days" | 2000-01-01T00:00:00.000Z | 2000-01-02T00:00:00.000Z | - | "months" | 2000-01-01T00:00:00.000Z | 2000-02-01T00:00:00.000Z | - | "years" | 2000-01-01T00:00:00.000Z | 2001-01-01T00:00:00.000Z | + | unit | output1 | output2 | + | "millis" | 2000-01-01T00:00:00.000Z | 2000-01-01T00:00:00.001Z | + | "seconds" | 2000-01-01T00:00:00.000Z | 2000-01-01T00:00:01.000Z | + | "minutes" | 2000-01-01T00:00:00.000Z | 2000-01-01T00:01:00.000Z | + | "hours" | 2000-01-01T00:00:00.000Z | 2000-01-01T01:00:00.000Z | + | "days" | 2000-01-01T00:00:00.000Z | 2000-01-02T00:00:00.000Z | + | "months" | 2000-01-01T00:00:00.000Z | 2000-02-01T00:00:00.000Z | + | "years" | 2000-01-01T00:00:00.000Z | 2001-01-01T00:00:00.000Z | Scenario Outline: User is able to specify supported temporal granularities with before operator Given foo is granular to @@ -50,18 +46,17 @@ Feature: User can specify that datetime fields are granular to a certain unit And the generator can generate at most 2 rows Then the following data should be generated: | foo | - | | - | | - + | | + | | Examples: - | unit | output1 | output2 | - | "millis" | 0001-01-01T00:00:00.000Z | 0001-01-01T00:00:00.001Z | - | "seconds" | 0001-01-01T00:00:00.000Z | 0001-01-01T00:00:01.000Z | - | "minutes" | 0001-01-01T00:00:00.000Z | 0001-01-01T00:01:00.000Z | - | "hours" | 0001-01-01T00:00:00.000Z | 0001-01-01T01:00:00.000Z | - | "days" | 0001-01-01T00:00:00.000Z | 0001-01-02T00:00:00.000Z | - | "months" | 0001-01-01T00:00:00.000Z | 0001-02-01T00:00:00.000Z | - | "years" | 0001-01-01T00:00:00.000Z | 0002-01-01T00:00:00.000Z | + | unit | output1 | output2 | + | "millis" | 0001-01-01T00:00:00.000Z | 0001-01-01T00:00:00.001Z | + | "seconds" | 0001-01-01T00:00:00.000Z | 0001-01-01T00:00:01.000Z | + | "minutes" | 0001-01-01T00:00:00.000Z | 0001-01-01T00:01:00.000Z | + | "hours" | 0001-01-01T00:00:00.000Z | 0001-01-01T01:00:00.000Z | + | "days" | 0001-01-01T00:00:00.000Z | 0001-01-02T00:00:00.000Z | + | "months" | 0001-01-01T00:00:00.000Z | 0001-02-01T00:00:00.000Z | + | "years" | 0001-01-01T00:00:00.000Z | 0002-01-01T00:00:00.000Z | Scenario Outline: User is able to specify supported temporal granularities with before or at operator Given foo is granular to @@ -69,18 +64,17 @@ Feature: User can specify that datetime fields are granular to a certain unit And the generator can generate at most 2 rows Then the following data should be generated: | foo | - | | - | | - + | | + | | Examples: - | unit | output1 | output2 | - | "millis" | 0001-01-01T00:00:00.000Z | 0001-01-01T00:00:00.001Z | - | "seconds" | 0001-01-01T00:00:00.000Z | 0001-01-01T00:00:01.000Z | - | "minutes" | 0001-01-01T00:00:00.000Z | 0001-01-01T00:01:00.000Z | - | "hours" | 0001-01-01T00:00:00.000Z | 0001-01-01T01:00:00.000Z | - | "days" | 0001-01-01T00:00:00.000Z | 0001-01-02T00:00:00.000Z | - | "months" | 0001-01-01T00:00:00.000Z | 0001-02-01T00:00:00.000Z | - | "years" | 0001-01-01T00:00:00.000Z | 0002-01-01T00:00:00.000Z | + | unit | output1 | output2 | + | "millis" | 0001-01-01T00:00:00.000Z | 0001-01-01T00:00:00.001Z | + | "seconds" | 0001-01-01T00:00:00.000Z | 0001-01-01T00:00:01.000Z | + | "minutes" | 0001-01-01T00:00:00.000Z | 0001-01-01T00:01:00.000Z | + | "hours" | 0001-01-01T00:00:00.000Z | 0001-01-01T01:00:00.000Z | + | "days" | 0001-01-01T00:00:00.000Z | 0001-01-02T00:00:00.000Z | + | "months" | 0001-01-01T00:00:00.000Z | 0001-02-01T00:00:00.000Z | + | "years" | 0001-01-01T00:00:00.000Z | 0002-01-01T00:00:00.000Z | Scenario: Applying two valid datetime granularTo constraints generates data that matches both (coarser) Given foo is granular to "millis" @@ -88,43 +82,42 @@ Feature: User can specify that datetime fields are granular to a certain unit And foo is after 2000-01-01T00:00:00.000Z And the generator can generate at most 1 rows Then the following data should be generated: - | foo | - | 2000-01-01T00:00:01.000Z | + | foo | + | 2000-01-01T00:00:01.000Z | Scenario: The one where a user can specify after working day granularity Given foo is granular to "working days" And foo is after 2019-10-04T00:00:00.000Z And the generator can generate at most 1 rows Then the following data should be generated: - | foo | - | 2019-10-07T00:00:00.000Z | + | foo | + | 2019-10-07T00:00:00.000Z | Scenario: The one where a user can specify before working day granularity Given foo is granular to "working days" And foo is after 2019-10-03T00:00:00.000Z And foo is before 2019-10-07T00:00:00.000Z Then the following data should be generated: - | foo | - | 2019-10-04T00:00:00.000Z | + | foo | + | 2019-10-04T00:00:00.000Z | - @ignore #pending development of #1426 - Make datetime friendly to use in the profile + @ignore #pending development of #1426 - Make datetime friendly to use in the profile Scenario Outline: The one where the datetime format is relaxed Given foo is granular to And foo is equal to And the generator can generate at most 1 rows Then the following data should be generated: - | foo | - | | - + | foo | + | | Examples: - | unit | constraintDate | output | - | "millis" | 2000-01-01T00:00:00.000Z | 2000-01-01T00:00:00.000Z | - | "seconds" | 2000-01-01T00:00:00 | 2000-01-01T00:00:00 | - | "minutes" | 2000-01-01T00:00 | 2000-01-01T00:00 | - | "hours" | 2000-01-01T00 | 2000-01-01T00 | - | "days" | 2000-01-01T | 2000-01-01T | - | "months" | 2000-01 | 2000-01 | - | "years" | 2000 | 2000 | + | unit | constraintDate | output | + | "millis" | 2000-01-01T00:00:00.000Z | 2000-01-01T00:00:00.000Z | + | "seconds" | 2000-01-01T00:00:00 | 2000-01-01T00:00:00 | + | "minutes" | 2000-01-01T00:00 | 2000-01-01T00:00 | + | "hours" | 2000-01-01T00 | 2000-01-01T00 | + | "days" | 2000-01-01T | 2000-01-01T | + | "months" | 2000-01 | 2000-01 | + | "years" | 2000 | 2000 | Scenario: Applying an invalid datetime granularTo constraint fails with an appropriate error Given foo is granular to "decades" diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Decimal.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Decimal.feature index d2274bfb0..ec33e202f 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Decimal.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Decimal.feature @@ -4,10 +4,7 @@ Feature: User can specify that a number has type decimal and can have varying nu Given the generation strategy is full And there is a non nullable field foo And foo has type "decimal" - - ### Numeric Constraints - Scenario: Greater than constraint with decimal type produces valid decimals Given foo is greater than 10 And the generator can generate at most 5 rows @@ -29,7 +26,6 @@ Feature: User can specify that a number has type decimal and can have varying nu | 10.00000000000000000002 | | 10.00000000000000000003 | | 10.00000000000000000004 | - #594 - Change to descending order? Scenario: Less than or equal to constraint with decimal type produces valid decimals Given foo is less than or equal to 10 @@ -41,7 +37,6 @@ Feature: User can specify that a number has type decimal and can have varying nu | -99999999999999999999.99999999999999999998 | | -99999999999999999999.99999999999999999997 | | -99999999999999999999.99999999999999999996 | - #594 - Change to descending order? Scenario: Less than constraint with decimal type produces valid decimals Given foo is less than 10 diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Integer.feature b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Integer.feature index 792c0bb67..6fd11c7fa 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Integer.feature +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/features/types/Integer.feature @@ -4,10 +4,7 @@ Feature: User can specify that a number has type integer and does not have any d Given the generation strategy is full And there is a non nullable field foo And foo has type "integer" - - ### Numeric Constraints - Scenario: Greater than constraint with integer type produces valid integers Given foo is greater than 10 And the generator can generate at most 5 rows @@ -29,7 +26,6 @@ Feature: User can specify that a number has type integer and does not have any d | 12 | | 13 | | 14 | - #594 - Change this to descending order? Scenario: Less than or equal to constraint with integer type produces valid integers Given foo is less than or equal to 10 @@ -42,7 +38,6 @@ Feature: User can specify that a number has type integer and does not have any d | -99999999999999999998 | | -99999999999999999997 | | -99999999999999999996 | - #594 - Change this to descending order? Scenario: Less than constraint with integer type produces valid integers Given foo is less than 10 diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/TestRunner.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/TestRunner.java index 0ab78b70e..d943d0179 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/TestRunner.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/TestRunner.java @@ -24,7 +24,7 @@ @CucumberOptions( plugin = {"null_summary"}, features = {"src/test/java/com/scottlogic/deg/orchestrator/cucumber/features"}, - glue={"com.scottlogic.deg.orchestrator.cucumber.testframework.steps"}, + glue = {"com.scottlogic.deg.orchestrator.cucumber.testframework.steps"}, monochrome = true, tags = "not @ignore" ) diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/BooleanValueStep.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/BooleanValueStep.java index 33c74ea99..3df3f0e84 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/BooleanValueStep.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/BooleanValueStep.java @@ -22,7 +22,8 @@ public class BooleanValueStep { private final CucumberTestState state; - public BooleanValueStep(CucumberTestState state){ + + public BooleanValueStep(CucumberTestState state) { this.state = state; } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/CucumberHooks.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/CucumberHooks.java index 70e5cee9f..2ee51d963 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/CucumberHooks.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/CucumberHooks.java @@ -22,7 +22,7 @@ public class CucumberHooks { @Before("@ignore") - public void beforeEachScenario(Scenario scenario){ + public void beforeEachScenario(Scenario scenario) { throw new AssumptionViolatedException(String.format("Scenario '%s' is ignored (%s)", scenario.getName(), scenario.getId())); } } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/GeneralTestStep.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/GeneralTestStep.java index c0f373d7b..43ea50673 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/GeneralTestStep.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/GeneralTestStep.java @@ -40,7 +40,7 @@ public class GeneralTestStep { private final CucumberTestState state; private CucumberTestHelper cucumberTestHelper; - public GeneralTestStep(CucumberTestState state){ + public GeneralTestStep(CucumberTestState state) { this.state = state; } @@ -80,7 +80,7 @@ public void setTheCombinationStrategy(CombinationStrategyType strategy) { } @When("we do not violate any {operator} constraints") - public void constraintTypeIsNotViolated(String operator){ + public void constraintTypeIsNotViolated(String operator) { this.state.addConstraintToNotViolate(AtomicConstraintType.fromText(operator)); } @@ -99,12 +99,12 @@ public void setTheGenerationMode(CucumberGenerationMode generationMode) { } @And("^(.+) is null$") - public void fieldIsNull(String fieldName) throws Exception{ + public void fieldIsNull(String fieldName) throws Exception { this.state.addConstraint(fieldName, ConstraintType.IS_NULL, true); } @And("^(.+) is anything but null$") - public void fieldIsNotNull(String fieldName) throws Exception{ + public void fieldIsNotNull(String fieldName) throws Exception { this.state.addNotConstraint(fieldName, ConstraintType.IS_NULL, true); } @@ -114,27 +114,27 @@ public void uniquefieldIsUnique(String fieldName) { } @And("^(.+) is equal to field (.+)$") - public void fieldEqualTo(String field, String otherField){ + public void fieldEqualTo(String field, String otherField) { state.addRelationConstraint(field, ConstraintType.EQUAL_TO_FIELD, otherField); } @When("^If and Then are described below$") - public void ifStartThen(){ + public void ifStartThen() { state.startCreatingIfConstraint(2); } @When("^If Then and Else are described below$") - public void ifStartThenElse(){ + public void ifStartThenElse() { state.startCreatingIfConstraint(3); } @And("All Of the next {number} constraints") - public void allOf(int count){ + public void allOf(int count) { state.startCreatingAllOfConstraint(count); } @And("Any Of the next {number} constraints") - public void anyOf(int count){ + public void anyOf(int count) { state.startCreatingAnyOfConstraint(count); } @@ -221,7 +221,7 @@ public void theFollowingDataShouldNotBeContainedInActual(List> data, Matcher>> matcher){ + private void assertOutputData(List> data, Matcher>> matcher) { assertNoGenerationErrors(); Assert.assertThat(data, matcher); @@ -239,7 +239,7 @@ private void assertNoGenerationErrors() { empty()); } - private List > getComparableExpectedResults(List> expectedResultsTable) { + private List> getComparableExpectedResults(List> expectedResultsTable) { return expectedResultsTable .stream() .map(row -> new ArrayList<>(row.values())) @@ -254,15 +254,15 @@ private List > getComparableExpectedResults(List> expectedResultsTable){ - List > expectedRowsOfResults = getComparableExpectedResults(expectedResultsTable); - List > data = cucumberTestHelper.generateAndGetData(); + private GeneratedTestData getExpectedAndGeneratedData(List> expectedResultsTable) { + List> expectedRowsOfResults = getComparableExpectedResults(expectedResultsTable); + List> data = cucumberTestHelper.generateAndGetData(); return new GeneratedTestData(expectedRowsOfResults, data); } @Then("some data should be generated") public void someDataShouldBeGenerated() { - List > data = cucumberTestHelper.generateAndGetData(); + List> data = cucumberTestHelper.generateAndGetData(); assertNoGenerationErrors(); Assert.assertThat("No data was generated but some was expected", data, not(empty())); @@ -270,12 +270,12 @@ public void someDataShouldBeGenerated() { @Then("{long} row(s) of data is/are generated") public void theExpectedNumberOfRowsAreGenerated(long expectedNumberOfRows) { - List > data = cucumberTestHelper.generateAndGetData(); + List> data = cucumberTestHelper.generateAndGetData(); assertNoGenerationErrors(); Assert.assertThat( "Unexpected number of rows returned", - (long)data.size(), + (long) data.size(), equalTo(expectedNumberOfRows)); } @@ -295,10 +295,10 @@ public void fooHasType(String fieldName, String type) { } class GeneratedTestData { - List > expectedData; - List > generatedData; + List> expectedData; + List> generatedData; - GeneratedTestData(List > expectedData, List > generatedData){ + GeneratedTestData(List> expectedData, List> generatedData) { this.expectedData = expectedData; this.generatedData = generatedData; } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/JSONTestStep.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/JSONTestStep.java index 2a48f8506..921e623cb 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/JSONTestStep.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/JSONTestStep.java @@ -26,7 +26,7 @@ public class JSONTestStep { private final CucumberTestState state; - public JSONTestStep(CucumberTestState state){ + public JSONTestStep(CucumberTestState state) { this.state = state; } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/MapValueStep.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/MapValueStep.java index 15b85e876..df3a3df56 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/MapValueStep.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/MapValueStep.java @@ -26,7 +26,7 @@ public class MapValueStep { private final CucumberTestState state; - public MapValueStep(CucumberTestState state){ + public MapValueStep(CucumberTestState state) { this.state = state; } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/NullValueStep.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/NullValueStep.java index a42d49436..590d07aba 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/NullValueStep.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/NullValueStep.java @@ -29,7 +29,7 @@ public class NullValueStep { private final CucumberTestState state; private final CucumberTestHelper helper; - public NullValueStep(CucumberTestState state, CucumberTestHelper helper){ + public NullValueStep(CucumberTestState state, CucumberTestHelper helper) { this.state = state; this.helper = helper; } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/NumericValueStep.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/NumericValueStep.java index 0978ab83e..50cf33694 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/NumericValueStep.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/NumericValueStep.java @@ -33,108 +33,108 @@ public class NumericValueStep { private final CucumberTestState state; private final CucumberTestHelper helper; - public NumericValueStep(CucumberTestState state, CucumberTestHelper helper){ + public NumericValueStep(CucumberTestState state, CucumberTestHelper helper) { this.state = state; this.helper = helper; } @And("^([A-z0-9]+) is equal to (-?[0-9\\.]+)$") - public void equalToNumber(String field, String value){ + public void equalToNumber(String field, String value) { state.addConstraint(field, ConstraintType.EQUAL_TO, tryParse(value)); } @And("^([A-z0-9]+) is greater than (-?[0-9\\.]+)$") - public void greaterThanNumber(String field, String value){ + public void greaterThanNumber(String field, String value) { state.addConstraint(field, ConstraintType.GREATER_THAN, tryParse(value)); } @And("^([A-z0-9]+) is greater than or equal to (-?[0-9\\.]+)$") - public void greaterThanOrEqualNumber(String field, String value){ + public void greaterThanOrEqualNumber(String field, String value) { state.addConstraint(field, ConstraintType.GREATER_THAN_OR_EQUAL_TO, tryParse(value)); } @And("^([A-z0-9]+) is less than (-?[0-9\\.]+)$") - public void lessThanNumber(String field, String value){ + public void lessThanNumber(String field, String value) { state.addConstraint(field, ConstraintType.LESS_THAN, tryParse(value)); } @And("^([A-z0-9]+) is less than or equal to (-?[0-9\\.]+)$") - public void lessThanOrEqualNumber(String field, String value){ + public void lessThanOrEqualNumber(String field, String value) { state.addConstraint(field, ConstraintType.LESS_THAN_OR_EQUAL_TO, tryParse(value)); } @And("^([A-z0-9]+) is granular to ([0-9\\.]+)$") - public void granularToNumber(String field, String value){ + public void granularToNumber(String field, String value) { state.addConstraint(field, ConstraintType.GRANULAR_TO, tryParse(value)); } @And("^([A-z0-9]+) is anything but equal to (-?[0-9\\.]+)$") - public void notEqualToNumber(String field, String value){ + public void notEqualToNumber(String field, String value) { state.addNotConstraint(field, ConstraintType.EQUAL_TO, tryParse(value)); } @And("^([A-z0-9]+) is anything but greater than (-?[0-9\\.]+)$") - public void notGreaterThanNumber(String field, String value){ + public void notGreaterThanNumber(String field, String value) { state.addNotConstraint(field, ConstraintType.GREATER_THAN, tryParse(value)); } @And("^([A-z0-9]+) is anything but greater than or equal to (-?[0-9\\.]+)$") - public void notGreaterThanOrEqualNumber(String field, String value){ + public void notGreaterThanOrEqualNumber(String field, String value) { state.addNotConstraint(field, ConstraintType.GREATER_THAN_OR_EQUAL_TO, tryParse(value)); } @And("^([A-z0-9]+) is anything but less than (-?[0-9\\.]+)$") - public void notLessThanNumber(String field, String value){ + public void notLessThanNumber(String field, String value) { state.addNotConstraint(field, ConstraintType.LESS_THAN, tryParse(value)); } @And("^([A-z0-9]+) is anything but less than or equal to (-?[0-9\\.]+)$") - public void notLessThanOrEqualNumber(String field, String value){ + public void notLessThanOrEqualNumber(String field, String value) { state.addNotConstraint(field, ConstraintType.LESS_THAN_OR_EQUAL_TO, tryParse(value)); } @And("^([A-z0-9]+) is anything but granular to ([0-9\\.]+)$") - public void notGranularToNumber(String field, String value){ + public void notGranularToNumber(String field, String value) { state.addNotConstraint(field, ConstraintType.GRANULAR_TO, tryParse(value)); } @And("^(.+) is greater than field ([A-z0-9]+)$") - public void numericGreater(String field, String otherField){ + public void numericGreater(String field, String otherField) { state.addRelationConstraint(field, ConstraintType.GREATER_THAN_FIELD, otherField); } @And("^(.+) is less than field ([A-z0-9]+)$") - public void numericLess(String field, String otherField){ + public void numericLess(String field, String otherField) { state.addRelationConstraint(field, ConstraintType.LESS_THAN_FIELD, otherField); } @And("^(.+) is greater than or equal to field ([A-z0-9]+)$") - public void numericGreaterEqual(String field, String otherField){ + public void numericGreaterEqual(String field, String otherField) { state.addRelationConstraint(field, ConstraintType.GREATER_THAN_OR_EQUAL_TO_FIELD, otherField); } @And("^(.+) is less than or equal to field ([A-z0-9]+)$") - public void numericLessEqual(String field, String otherField){ + public void numericLessEqual(String field, String otherField) { state.addRelationConstraint(field, ConstraintType.LESS_THAN_OR_EQUAL_TO_FIELD, otherField); } @Then("{fieldVar} contains numeric data") - public void producedDataShouldContainNumericValuesForField(String fieldName){ + public void producedDataShouldContainNumericValuesForField(String fieldName) { helper.assertFieldContainsSomeOf(fieldName, Number.class); } @Then("{fieldVar} contains only numeric data") - public void producedDataShouldContainOnlyNumericValuesForField(String fieldName){ + public void producedDataShouldContainOnlyNumericValuesForField(String fieldName) { helper.assertFieldContainsNullOrMatching(fieldName, Number.class); } @Then("{fieldVar} contains anything but numeric data") - public void producedDataShouldContainAnythingButStringValuesForField(String fieldName){ + public void producedDataShouldContainAnythingButStringValuesForField(String fieldName) { helper.assertFieldContainsNullOrNotMatching(fieldName, Number.class); } @Then("{fieldVar} contains numeric values between {number} and {number} inclusively") - public void producedDataShouldContainNumericValuesInRangeForField(String fieldName, Number minInclusive, Number maxInclusive){ + public void producedDataShouldContainNumericValuesInRangeForField(String fieldName, Number minInclusive, Number maxInclusive) { helper.assertFieldContainsNullOrMatching( fieldName, Number.class, @@ -142,7 +142,7 @@ public void producedDataShouldContainNumericValuesInRangeForField(String fieldNa } @Then("{fieldVar} contains numeric values less than or equal to {number}") - public void producedDataShouldContainNumericValuesLessThanForField(String fieldName, Number lessThanInclusive){ + public void producedDataShouldContainNumericValuesLessThanForField(String fieldName, Number lessThanInclusive) { helper.assertFieldContainsNullOrMatching( fieldName, Number.class, @@ -150,7 +150,7 @@ public void producedDataShouldContainNumericValuesLessThanForField(String fieldN } @Then("{fieldVar} contains numeric values greater than or equal to {number}") - public void producedDataShouldContainNumericValuesGreaterThanForField(String fieldName, Number greaterThanInclusive){ + public void producedDataShouldContainNumericValuesGreaterThanForField(String fieldName, Number greaterThanInclusive) { helper.assertFieldContainsNullOrMatching( fieldName, Number.class, @@ -158,25 +158,25 @@ public void producedDataShouldContainNumericValuesGreaterThanForField(String fie } @Then("{fieldVar} contains numeric values outside {number} and {number}") - public void producedDataShouldContainNumericValuesOutOfRangeForField(String fieldName, Number min, Number max){ + public void producedDataShouldContainNumericValuesOutOfRangeForField(String fieldName, Number min, Number max) { helper.assertFieldContainsNullOrMatching( fieldName, Number.class, value -> !isBetweenInclusively(min, max).apply(value)); } - private Function isBetweenInclusively(Number minInclusive, Number maxInclusive){ + private Function isBetweenInclusively(Number minInclusive, Number maxInclusive) { return value -> isGreaterThanOrEqual(value, minInclusive) && isLessThanOrEqual(value, maxInclusive); } - private boolean isGreaterThanOrEqual(Number value, Number minInclusive){ + private boolean isGreaterThanOrEqual(Number value, Number minInclusive) { BigDecimal valueAsBigDecimal = coerceToBigDecimal(value); BigDecimal minInclusiveAsBigDecimal = coerceToBigDecimal(minInclusive); return valueAsBigDecimal.compareTo(minInclusiveAsBigDecimal) >= 0; } - private boolean isLessThanOrEqual(Number value, Number maxInclusive){ + private boolean isLessThanOrEqual(Number value, Number maxInclusive) { BigDecimal valueAsBigDecimal = coerceToBigDecimal(value); BigDecimal maxInclusiveAsBigDecimal = coerceToBigDecimal(maxInclusive); diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/RegexValueStep.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/RegexValueStep.java index f7780def2..c6bcb3496 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/RegexValueStep.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/RegexValueStep.java @@ -29,7 +29,7 @@ public class RegexValueStep { private final CucumberTestState state; private final CucumberTestHelper helper; - public RegexValueStep(CucumberTestState state, CucumberTestHelper helper){ + public RegexValueStep(CucumberTestState state, CucumberTestHelper helper) { this.state = state; this.helper = helper; } @@ -60,7 +60,7 @@ public void notContainingRegexString(String fieldName, String value) { } @Then("{fieldVar} contains strings matching {regex}") - public void producedDataShouldContainStringValuesMatchingRegex(String fieldName, String regex){ + public void producedDataShouldContainStringValuesMatchingRegex(String fieldName, String regex) { Pattern pattern = Pattern.compile(regex); helper.assertFieldContainsNullOrMatching( @@ -70,7 +70,7 @@ public void producedDataShouldContainStringValuesMatchingRegex(String fieldName, } @Then("{fieldVar} contains anything but strings matching {regex}") - public void producedDataShouldContainStringValuesNotMatchingRegex(String fieldName, String regex){ + public void producedDataShouldContainStringValuesNotMatchingRegex(String fieldName, String regex) { Pattern pattern = Pattern.compile(regex); helper.assertFieldContainsNullOrMatching( diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/SetValueStep.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/SetValueStep.java index 60d0c7842..b8aff46d1 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/SetValueStep.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/SetValueStep.java @@ -26,7 +26,7 @@ public class SetValueStep { private final CucumberTestState state; - public SetValueStep(CucumberTestState state){ + public SetValueStep(CucumberTestState state) { this.state = state; } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/StringValueStep.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/StringValueStep.java index d950b0474..08fe6be0c 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/StringValueStep.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/StringValueStep.java @@ -31,7 +31,7 @@ public class StringValueStep { private final CucumberTestState state; private final CucumberTestHelper helper; - public StringValueStep(CucumberTestState state, CucumberTestHelper helper){ + public StringValueStep(CucumberTestState state, CucumberTestHelper helper) { this.state = state; this.helper = helper; } @@ -77,22 +77,22 @@ public void notOfLengthString(String fieldName, String value) { } @Then("{fieldVar} contains only string data") - public void producedDataShouldContainOnlyStringValuesForField(String fieldName){ + public void producedDataShouldContainOnlyStringValuesForField(String fieldName) { helper.assertFieldContainsNullOrMatching(fieldName, String.class); } @Then("{fieldVar} contains string data") - public void producedDataShouldContainStringValuesForField(String fieldName){ + public void producedDataShouldContainStringValuesForField(String fieldName) { helper.assertFieldContainsSomeOf(fieldName, String.class); } @Then("{fieldVar} contains anything but string data") - public void producedDataShouldContainAnythingButStringValuesForField(String fieldName){ + public void producedDataShouldContainAnythingButStringValuesForField(String fieldName) { helper.assertFieldContainsNullOrNotMatching(fieldName, String.class); } @Then("{fieldVar} contains strings of length between {int} and {int} inclusively") - public void producedDataShouldContainStringValuesInRangeForField(String fieldName, int minInclusive, int maxInclusive){ + public void producedDataShouldContainStringValuesInRangeForField(String fieldName, int minInclusive, int maxInclusive) { helper.assertFieldContainsNullOrMatching( fieldName, String.class, @@ -100,7 +100,7 @@ public void producedDataShouldContainStringValuesInRangeForField(String fieldNam } @Then("{fieldVar} contains strings shorter than or equal to {int}") - public void producedDataShouldContainStringValuesShorterThanForField(String fieldName, int shorterThanInclusive){ + public void producedDataShouldContainStringValuesShorterThanForField(String fieldName, int shorterThanInclusive) { helper.assertFieldContainsNullOrMatching( fieldName, String.class, @@ -108,7 +108,7 @@ public void producedDataShouldContainStringValuesShorterThanForField(String fiel } @Then("{fieldVar} contains strings longer than or equal to {int}") - public void producedDataShouldContainStringValuesLongerThanForField(String fieldName, int longerThanInclusive){ + public void producedDataShouldContainStringValuesLongerThanForField(String fieldName, int longerThanInclusive) { helper.assertFieldContainsNullOrMatching( fieldName, String.class, @@ -116,14 +116,14 @@ public void producedDataShouldContainStringValuesLongerThanForField(String field } @Then("{fieldVar} contains strings of length outside {int} and {int}") - public void producedDataShouldContainStringValuesOutOfRangeForField(String fieldName, int min, int max){ + public void producedDataShouldContainStringValuesOutOfRangeForField(String fieldName, int min, int max) { helper.assertFieldContainsNullOrMatching( fieldName, String.class, value -> !isLengthBetweenInclusively(min, max).apply(value)); } - private Function isLengthBetweenInclusively(int minInclusive, int maxInclusive){ + private Function isLengthBetweenInclusively(int minInclusive, int maxInclusive) { return value -> isLongerThanOrEqual(value, minInclusive) && isShorterThanOrEqual(value, maxInclusive); } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/TypeRegistryConfiguration.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/TypeRegistryConfiguration.java index 1aba94b9a..37cbc5e2f 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/TypeRegistryConfiguration.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/steps/TypeRegistryConfiguration.java @@ -37,7 +37,7 @@ public class TypeRegistryConfiguration implements TypeRegistryConfigurer { private final Set allOperators = new HashSet<>(Arrays.asList(AtomicConstraintType.values())); @Override - public Locale locale(){ + public Locale locale() { return Locale.ENGLISH; } @@ -47,8 +47,8 @@ public void configureTypeRegistry(TypeRegistry tr) { this.defineCombinationStrategyType(tr); this.defineOperationParameterType(tr); this.defineGenerationMode(tr); - this.defineParameterType(tr,"fieldVar", "^(.+)"); - this.defineParameterType(tr,"regex", "/(.+)/$"); + this.defineParameterType(tr, "fieldVar", "^(.+)"); + this.defineParameterType(tr, "regex", "/(.+)/$"); tr.setDefaultDataTableCellTransformer(new DataTableCellTransformer()); tr.defineParameterType(new ParameterType<>( @@ -70,7 +70,7 @@ public void configureTypeRegistry(TypeRegistry tr) { this::extractConstraint)); } - private void defineOperationParameterType(TypeRegistry tr){ + private void defineOperationParameterType(TypeRegistry tr) { tr.defineParameterType(new ParameterType<>( "operator", this.getHumanReadableOperationRegex(allOperators), @@ -84,14 +84,14 @@ private void defineParameterType(TypeRegistry tr, String name, String regex) { name, regex, String.class, - (Transformer)fieldName -> fieldName)); + (Transformer) fieldName -> fieldName)); } - private void defineDataGenerationStrategyType(TypeRegistry tr){ + private void defineDataGenerationStrategyType(TypeRegistry tr) { Transformer transformer = strategyString -> Arrays.stream(DataGenerationType.values()) - .filter(val -> val.toString().equalsIgnoreCase(strategyString)) - .findFirst().orElse(DataGenerationType.FULL_SEQUENTIAL); + .filter(val -> val.toString().equalsIgnoreCase(strategyString)) + .findFirst().orElse(DataGenerationType.FULL_SEQUENTIAL); tr.defineParameterType(new ParameterType<>( "generationStrategy", @@ -100,7 +100,7 @@ private void defineDataGenerationStrategyType(TypeRegistry tr){ transformer)); } - private void defineCombinationStrategyType(TypeRegistry tr){ + private void defineCombinationStrategyType(TypeRegistry tr) { Transformer transformer = strategyString -> Arrays.stream(CombinationStrategyType.values()) .filter(val -> val.toString().equalsIgnoreCase(strategyString)) @@ -135,11 +135,11 @@ private String extractConstraint(String gherkinConstraint) { .collect(Collectors.joining()); } - private String getHumanReadableOperationRegex(Set types){ + private String getHumanReadableOperationRegex(Set types) { return types.stream() - .map(act -> act.toString().replaceAll("([a-z])([A-Z]+)", "$1 $2").toLowerCase()) - .collect(Collectors.joining("|", "(", ")")); + .map(act -> act.toString().replaceAll("([a-z])([A-Z]+)", "$1 $2").toLowerCase()) + .collect(Collectors.joining("|", "(", ")")); } private class DataTableCellTransformer implements TableCellByTypeTransformer { @@ -148,7 +148,7 @@ public T transform(String value, Class aClass) throws Throwable { try { return aClass.cast(GeneratorTestUtilities.parseInput(value.trim())); } catch (JsonParseException | InvalidProfileException e) { - return (T)e; + return (T) e; } } } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberErrorReporter.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberErrorReporter.java index 58d86ca4e..1bcce00d1 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberErrorReporter.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberErrorReporter.java @@ -34,7 +34,7 @@ public void displayException(Exception e) { } @Override - public void displayValidation(ValidationException e){ + public void displayValidation(ValidationException e) { state.testExceptions.addAll(e.errorMessages.stream().map(ValidationException::new).collect(Collectors.toList())); } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberFileReader.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberFileReader.java index 48df5fe59..a42c17d63 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberFileReader.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberFileReader.java @@ -5,8 +5,7 @@ import javax.inject.Inject; -public class CucumberFileReader extends FileReader -{ +public class CucumberFileReader extends FileReader { private final CucumberTestState testState; @Inject @@ -16,8 +15,7 @@ public CucumberFileReader(CucumberTestState testState) { } @Override - public DistributedList listFromMapFile(String file, String key) - { + public DistributedList listFromMapFile(String file, String key) { return DistributedList.uniform(testState.getValuesFromMap(file, key)); } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberGenerationConfigSource.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberGenerationConfigSource.java index 52f9a0da4..f592d645f 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberGenerationConfigSource.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberGenerationConfigSource.java @@ -99,7 +99,9 @@ public OutputFormat getOutputFormat() { } @Override - public String fromFilePath() { return ""; } + public String fromFilePath() { + return ""; + } @Override public VisualiserLevel getVisualiserLevel() { diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberProfileReader.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberProfileReader.java index ed0e02c22..c844957ff 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberProfileReader.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberProfileReader.java @@ -41,7 +41,7 @@ public Profile read() throws IOException { return super.read(createJson()); } - private String createJson() throws IOException{ + private String createJson() throws IOException { ProfileDTO profileDTO = new ProfileDTO(); profileDTO.schemaVersion = "0.10"; profileDTO.fields = state.profileFields; diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberTestHelper.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberTestHelper.java index e5c3b46bf..13a8d9e08 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberTestHelper.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberTestHelper.java @@ -48,10 +48,9 @@ public CucumberTestHelper(CucumberTestState testState) { } public void runGenerationProcess() { - if (testState.expectExceptions){ + if (testState.expectExceptions) { generateAndExpectExceptions(); - } - else { + } else { try { doGeneration(); } catch (IOException e) { @@ -65,7 +64,7 @@ private void generateAndExpectExceptions() { doGeneration(); } catch (IOException e) { testState.addException(e); - } catch (ValidationException e){ + } catch (ValidationException e) { testState.testExceptions.addAll(e.errorMessages.stream().map(ValidationException::new).collect(Collectors.toList())); } } @@ -131,7 +130,7 @@ public void assertFieldContainsNullOrMatching( String fieldName, Class clazz, Function predicate - ){ + ) { assertFieldContainsOnly(fieldName, objectValue -> { if (objectValue == null) { return true; @@ -152,11 +151,7 @@ public void assertFieldContainsNullOrNotMatching(String fieldName, Class return true; } - if (clazz.isInstance(objectValue)) { - return false; //matches, but shouldn't match the type - } - - return true; + return !clazz.isInstance(objectValue); //matches, but shouldn't match the type }); } @@ -205,11 +200,7 @@ private Optional getIndexOfField(String fieldName) { public void assertFieldContainsSomeOf(String fieldName, Class clazz) { assertFieldContains(fieldName, objectValue -> { - if (clazz.isInstance(objectValue)) { - return true; - } - - return false; //doesn't match the type when it should. + return clazz.isInstance(objectValue);//doesn't match the type when it should. }); } } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberTestState.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberTestState.java index a90a48f3d..cc33c344d 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberTestState.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/CucumberTestState.java @@ -44,7 +44,7 @@ public class CucumberTestState { public long maxRows = 200; List> generatedObjects = new ArrayList<>(); - List profileFields = new ArrayList<>();; + List profileFields = new ArrayList<>(); List constraints = new ArrayList<>(); List testExceptions = new ArrayList<>(); Map>> inMapFiles = new HashMap<>(); @@ -95,7 +95,7 @@ public List getValuesFromMap(String name, String key) { int index = map.get(0).indexOf(key); List rtnList = new ArrayList<>(); - for (int i = 1; i < map.size() ; i++) { + for (int i = 1; i < map.size(); i++) { rtnList.add(map.get(i).get(index)); } return rtnList; @@ -115,11 +115,11 @@ public void addNullableField(String fieldName) { this.profileFields.add(fieldDTO); } - public void addException(Exception e){ + public void addException(Exception e) { this.testExceptions.add(e); } - public void addConstraintToNotViolate(AtomicConstraintType atomicConstraintType){ + public void addConstraintToNotViolate(AtomicConstraintType atomicConstraintType) { contstraintsToNotViolate.add(atomicConstraintType); } @@ -127,115 +127,95 @@ public List getConstraintsToNotViolate() { return contstraintsToNotViolate; } - private ConstraintDTO createConstraint(String fieldName, ConstraintType type, Object _value) - { - switch (type) - { + private ConstraintDTO createConstraint(String fieldName, ConstraintType type, Object _value) { + switch (type) { case EQUAL_TO: - return new EqualToConstraintDTO() - {{ + return new EqualToConstraintDTO() {{ field = fieldName; value = _value; }}; case IN_SET: return _value instanceof String - ? new InSetFromFileConstraintDTO() - {{ + ? new InSetFromFileConstraintDTO() {{ field = fieldName; - file = (String)_value; + file = (String) _value; }} - : new InSetOfValuesConstraintDTO() - {{ + : new InSetOfValuesConstraintDTO() {{ field = fieldName; - values = (Collection)_value; + values = (Collection) _value; }}; case IS_NULL: - return new NullConstraintDTO() - {{ + return new NullConstraintDTO() {{ field = fieldName; - isNull = (boolean)_value; + isNull = (boolean) _value; }}; case GRANULAR_TO: - return new GranularToConstraintDTO() - {{ + return new GranularToConstraintDTO() {{ field = fieldName; value = _value; }}; case MATCHES_REGEX: - return new MatchesRegexConstraintDTO() - {{ + return new MatchesRegexConstraintDTO() {{ field = fieldName; value = (String) _value; }}; case CONTAINS_REGEX: - return new ContainsRegexConstraintDTO() - {{ + return new ContainsRegexConstraintDTO() {{ field = fieldName; value = (String) _value; }}; case OF_LENGTH: - return new OfLengthConstraintDTO() - {{ + return new OfLengthConstraintDTO() {{ field = fieldName; - value = (int)_value; + value = (int) _value; }}; case LONGER_THAN: - return new LongerThanConstraintDTO() - {{ + return new LongerThanConstraintDTO() {{ field = fieldName; value = (int) _value; }}; case SHORTER_THAN: - return new ShorterThanConstraintDTO() - {{ + return new ShorterThanConstraintDTO() {{ field = fieldName; value = (int) _value; }}; case GREATER_THAN: - return new GreaterThanConstraintDTO() - {{ + return new GreaterThanConstraintDTO() {{ field = fieldName; value = (Number) _value; }}; case GREATER_THAN_OR_EQUAL_TO: - return new GreaterThanOrEqualToConstraintDTO() - {{ + return new GreaterThanOrEqualToConstraintDTO() {{ field = fieldName; value = (Number) _value; }}; case LESS_THAN: - return new LessThanConstraintDTO() - {{ + return new LessThanConstraintDTO() {{ field = fieldName; value = (Number) _value; }}; case LESS_THAN_OR_EQUAL_TO: - return new LessThanOrEqualToConstraintDTO() - {{ + return new LessThanOrEqualToConstraintDTO() {{ field = fieldName; value = (Number) _value; }}; case AFTER: - return new AfterConstraintDTO() - {{ + return new AfterConstraintDTO() {{ field = fieldName; value = (String) _value; }}; case AFTER_OR_AT: - return new AfterOrAtConstraintDTO() - {{ + return new AfterOrAtConstraintDTO() {{ field = fieldName; value = (String) _value; }}; case BEFORE: - return new BeforeConstraintDTO() - {{ + return new BeforeConstraintDTO() {{ field = fieldName; value = (String) _value; }}; case BEFORE_OR_AT: - return new BeforeOrAtConstraintDTO() - {{ + return new BeforeOrAtConstraintDTO() {{ field = fieldName; value = (String) _value; }}; @@ -252,35 +232,52 @@ private ConstraintDTO createNotConstraint(String fieldName, ConstraintType type, private ConstraintDTO createRelationConstraint(String field, ConstraintType type, String other) { RelationalConstraintDTO relationalConstraintDTO; - switch (type) - { + switch (type) { case EQUAL_TO_FIELD: - relationalConstraintDTO = new EqualToFieldConstraintDTO(){{otherField = other;}}; + relationalConstraintDTO = new EqualToFieldConstraintDTO() {{ + otherField = other; + }}; break; case GREATER_THAN_FIELD: - relationalConstraintDTO = new GreaterThanFieldConstraintDTO(){{otherField = other;}}; + relationalConstraintDTO = new GreaterThanFieldConstraintDTO() {{ + otherField = other; + }}; break; case GREATER_THAN_OR_EQUAL_TO_FIELD: - relationalConstraintDTO = new GreaterThanOrEqualToFieldConstraintDTO(){{otherField = other;}}; + relationalConstraintDTO = new GreaterThanOrEqualToFieldConstraintDTO() {{ + otherField = other; + }}; break; case LESS_THAN_FIELD: - relationalConstraintDTO = new LessThanFieldConstraintDTO(){{otherField = other;}}; + relationalConstraintDTO = new LessThanFieldConstraintDTO() {{ + otherField = other; + }}; break; case LESS_THAN_OR_EQUAL_TO_FIELD: - relationalConstraintDTO = new LessThanOrEqualToFieldConstraintDTO(){{otherField = other;}}; + relationalConstraintDTO = new LessThanOrEqualToFieldConstraintDTO() {{ + otherField = other; + }}; break; case AFTER_FIELD: - relationalConstraintDTO = new AfterFieldConstraintDTO(){{otherField = other;}}; + relationalConstraintDTO = new AfterFieldConstraintDTO() {{ + otherField = other; + }}; break; case AFTER_OR_AT_FIELD: - relationalConstraintDTO = new AfterOrAtFieldConstraintDTO(){{otherField = other;}}; + relationalConstraintDTO = new AfterOrAtFieldConstraintDTO() {{ + otherField = other; + }}; break; case BEFORE_FIELD: - relationalConstraintDTO = new BeforeFieldConstraintDTO(){{otherField = other;}}; + relationalConstraintDTO = new BeforeFieldConstraintDTO() {{ + otherField = other; + }}; break; case BEFORE_OR_AT_FIELD: - relationalConstraintDTO = new BeforeOrAtFieldConstraintDTO(){{otherField = other;}}; - break; + relationalConstraintDTO = new BeforeOrAtFieldConstraintDTO() {{ + otherField = other; + }}; + break; default: throw new IllegalStateException("Unexpected value: " + type); } @@ -417,5 +414,7 @@ void reduceRemaining() { class ConstraintHolder { public Collection constraints; - public ConstraintHolder(){} + + public ConstraintHolder() { + } } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/GeneratorTestUtilities.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/GeneratorTestUtilities.java index bfbf19788..d48c6a20a 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/GeneratorTestUtilities.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/GeneratorTestUtilities.java @@ -46,7 +46,7 @@ public static Object parseInput(String input) throws JsonParseException { return null; } else if (input.matches("[+-]?(\\d+(\\.\\d+)?)")) { return parseNumber(input); - } else if (input.equals("true") || input.equals("false")){ + } else if (input.equals("true") || input.equals("false")) { return input.equals("true"); } @@ -56,11 +56,9 @@ public static Object parseInput(String input) throws JsonParseException { public static Object parseNumber(String input) throws JsonParseException { try { return mapper.readerFor(Number.class).readValue(input); - } - catch (JsonParseException e){ + } catch (JsonParseException e) { throw e; - } - catch (IOException e) { + } catch (IOException e) { Assert.fail("Unexpected IO exception " + e.toString()); return ""; } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/InMemoryOutputTarget.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/InMemoryOutputTarget.java index 6482d69ac..a1eb33c97 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/InMemoryOutputTarget.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/InMemoryOutputTarget.java @@ -62,6 +62,7 @@ public void writeRow(GeneratedObject row) { } @Override - public void close() {} + public void close() { + } } } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/ListPredicateMatcher.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/ListPredicateMatcher.java index e3c19609b..5b8eaf2ea 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/ListPredicateMatcher.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/ListPredicateMatcher.java @@ -47,10 +47,10 @@ public boolean matches(Object o) { List values = (List) o; checkedRows = values.size(); - for (int index = 0; index < values.size(); index++){ + for (int index = 0; index < values.size(); index++) { Object value = values.get(index); - if (!predicate.apply(value)){ + if (!predicate.apply(value)) { rowsThatDoNotMatch.put(index, value); } } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/RowMatcher.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/RowMatcher.java index 02477ce47..32d0b4fec 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/RowMatcher.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/RowMatcher.java @@ -51,7 +51,7 @@ public boolean matches(Object o) { Iterator actualRowIterator = actualRow.iterator(); Iterator expectedRowIterator = expectedRow.iterator(); - while (actualRowIterator.hasNext()){ + while (actualRowIterator.hasNext()) { Object actualColumnValue = actualRowIterator.next(); if (!expectedRowIterator.hasNext()) @@ -73,7 +73,7 @@ private boolean objectsEquals(Object actual, Object expected) { if (actual == null || expected == null) return false; - if (actual instanceof Number && expected instanceof Number && actual.getClass() != expected.getClass()){ + if (actual instanceof Number && expected instanceof Number && actual.getClass() != expected.getClass()) { return numbersEqual((Number) actual, (Number) expected); } @@ -82,7 +82,8 @@ private boolean objectsEquals(Object actual, Object expected) { /** * Compares two numbers by casting up to the widest supported number type, BigDecimal. - * @param actual Actual number of any Number type + * + * @param actual Actual number of any Number type * @param expected Expected number of any Number type * @return True if numbers are mathematically equal, i.e. have the same value */ @@ -105,8 +106,8 @@ static List formatDatesInRow(List row) { return row.stream().map(RowMatcher::formatDate).collect(Collectors.toList()); } - private static Object formatDate(Object value){ - if (value instanceof OffsetDateTime){ + private static Object formatDate(Object value) { + if (value instanceof OffsetDateTime) { return ((OffsetDateTime) value).format(dateTimeFormat); } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/RowsAbsentMatcher.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/RowsAbsentMatcher.java index 875e1c714..f9ddfb009 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/RowsAbsentMatcher.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/RowsAbsentMatcher.java @@ -60,15 +60,15 @@ public void describeMismatch(Object item, Description description) { .collect(Collectors.joining(", "))); description.appendText("\n"); - description.appendList(" found: ",", ", "", foundRowMatchers); + description.appendList(" found: ", ", ", "", foundRowMatchers); } private Collection getFoundRowMatchers(List> actualRows) { Collection expectedMatchers = getExpectedMatchers(); ArrayList missingRowMatchers = new ArrayList<>(); - for (RowMatcher expectedMatcher : expectedMatchers){ - if (actualRows.stream().anyMatch(expectedMatcher::matches)){ + for (RowMatcher expectedMatcher : expectedMatchers) { + if (actualRows.stream().anyMatch(expectedMatcher::matches)) { missingRowMatchers.add(expectedMatcher); } } diff --git a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/RowsPresentMatcher.java b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/RowsPresentMatcher.java index 7643d732d..b818f77c9 100644 --- a/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/RowsPresentMatcher.java +++ b/orchestrator/src/test/java/com/scottlogic/deg/orchestrator/cucumber/testframework/utils/RowsPresentMatcher.java @@ -61,15 +61,15 @@ public void describeMismatch(Object item, Description description) { .collect(Collectors.joining(", "))); description.appendText("\n"); - description.appendList(" missing: ",", ", "", missingRowMatchers); + description.appendList(" missing: ", ", ", "", missingRowMatchers); } private Collection getMissingRowMatchers(List> actualRows) { Collection expectedMatchers = getExpectedMatchers(); ArrayList missingRowMatchers = new ArrayList<>(); - for (RowMatcher expectedMatcher : expectedMatchers){ - if (actualRows.stream().noneMatch(expectedMatcher::matches)){ + for (RowMatcher expectedMatcher : expectedMatchers) { + if (actualRows.stream().noneMatch(expectedMatcher::matches)) { missingRowMatchers.add(expectedMatcher); } } diff --git a/profile/src/test/java/com/scottlogic/deg/profile/reader/JsonProfileReaderTests.java b/profile/src/test/java/com/scottlogic/deg/profile/reader/JsonProfileReaderTests.java index 2b987c547..f0429e048 100644 --- a/profile/src/test/java/com/scottlogic/deg/profile/reader/JsonProfileReaderTests.java +++ b/profile/src/test/java/com/scottlogic/deg/profile/reader/JsonProfileReaderTests.java @@ -1066,7 +1066,8 @@ public void formatting_withDateType_shouldSetCorrectGranularity() throws IOExcep " \"schemaVersion\": " + schemaVersion + "," + " \"fields\": [ { " + " \"name\": \"foo\" ," + - " \"type\": \"date\"" + + " \"type\": \"date\"," + + " \"nullable\": \"true\"" + " }]," + " \"rules\": []" + "}");