tableSchema;
- @JsonProperty(value = "foreign_key_primary_key_columns_mappings", required = true)
- @NotNull
- @Size(min = 1, message = "must have at least one element")
- private Map<@NotBlank String, @NotBlank String> foreignKeyPrimaryKeyColumnsMappings;
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/PrimaryKeyDefinition.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/PrimaryKeyDefinition.java
deleted file mode 100644
index bd0e102ba..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/PrimaryKeyDefinition.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Posmulten library is an open-source project for the generation
- * of SQL DDL statements that make it easy for implementation of
- * Shared Schema Multi-tenancy strategy via the Row Security
- * Policies in the Postgres database.
- *
- * Copyright (C) 2020 Szymon Tarnowski
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-package com.github.starnowski.posmulten.configuration.yaml.model;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import lombok.experimental.Accessors;
-
-import javax.validation.constraints.NotBlank;
-import java.util.Map;
-
-@Accessors(chain = true)
-@Getter
-@Setter
-@EqualsAndHashCode
-@ToString
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class PrimaryKeyDefinition {
-
- @JsonProperty(value = "pk_columns_name_to_type")
- private Map<@NotBlank String, @NotBlank String> primaryKeyColumnsNameToTypeMap;
- @NotBlank(groups = NameForFunctionThatChecksIfRecordExistsInTableNotBlank.class)
- @JsonProperty(value = "name_for_function_that_checks_if_record_exists_in_table")
- private String nameForFunctionThatChecksIfRecordExistsInTable;
-
- public interface NameForFunctionThatChecksIfRecordExistsInTableNotBlank {}
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/RLSPolicy.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/RLSPolicy.java
deleted file mode 100644
index c67c45e9d..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/RLSPolicy.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * Posmulten library is an open-source project for the generation
- * of SQL DDL statements that make it easy for implementation of
- * Shared Schema Multi-tenancy strategy via the Row Security
- * Policies in the Postgres database.
- *
- * Copyright (C) 2020 Szymon Tarnowski
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-package com.github.starnowski.posmulten.configuration.yaml.model;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import lombok.experimental.Accessors;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotBlank;
-
-@Accessors(chain = true)
-@Getter
-@Setter
-@EqualsAndHashCode
-@ToString
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class RLSPolicy {
- @NotBlank
- @JsonProperty(value = "name", required = true)
- private String name;
- @Valid
- @JsonProperty(value = "tenant_column")
- private StringWrapperWithNotBlankValue tenantColumn;
- @JsonProperty(value = "create_tenant_column_for_table")
- private Boolean createTenantColumnForTable;
- @Valid
- @JsonProperty(value = "valid_tenant_value_constraint_name")
- private StringWrapperWithNotBlankValue validTenantValueConstraintName;
- @JsonProperty(value = "skip_adding_of_tenant_column_default_value")
- private Boolean skipAddingOfTenantColumnDefaultValue;
- @Valid
- @JsonProperty(value = "primary_key_definition")
- private PrimaryKeyDefinition primaryKeyDefinition;
- public RLSPolicy setTenantColumn(String tenantColumn) {
- this.tenantColumn = new StringWrapperWithNotBlankValue(tenantColumn);
- return this;
- }
-
- public RLSPolicy setValidTenantValueConstraintName(String validTenantValueConstraintName) {
- this.validTenantValueConstraintName = new StringWrapperWithNotBlankValue(validTenantValueConstraintName);
- return this;
- }
-
- public RLSPolicy setTenantColumn(StringWrapperWithNotBlankValue tenantColumn) {
- this.tenantColumn = tenantColumn;
- return this;
- }
-
- public RLSPolicy setValidTenantValueConstraintName(StringWrapperWithNotBlankValue validTenantValueConstraintName) {
- this.validTenantValueConstraintName = validTenantValueConstraintName;
- return this;
- }
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/SharedSchemaContextConfiguration.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/SharedSchemaContextConfiguration.java
deleted file mode 100644
index 35059a2ef..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/SharedSchemaContextConfiguration.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- * Posmulten library is an open-source project for the generation
- * of SQL DDL statements that make it easy for implementation of
- * Shared Schema Multi-tenancy strategy via the Row Security
- * Policies in the Postgres database.
- *
- * Copyright (C) 2020 Szymon Tarnowski
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-package com.github.starnowski.posmulten.configuration.yaml.model;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import lombok.experimental.Accessors;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotBlank;
-import java.util.List;
-
-@Accessors(chain = true)
-@Getter
-@Setter
-@EqualsAndHashCode
-@ToString
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class SharedSchemaContextConfiguration {
-
- @NotBlank
- @JsonProperty(value = "default_schema", required = true)
- private String defaultSchema;
- @Valid
- @JsonProperty(value = "current_tenant_id_property_type")
- private StringWrapperWithNotBlankValue currentTenantIdPropertyType;
- @Valid
- @JsonProperty(value = "current_tenant_id_property")
- private StringWrapperWithNotBlankValue currentTenantIdProperty;
- @Valid
- @JsonProperty(value = "get_current_tenant_id_function_name")
- private StringWrapperWithNotBlankValue getCurrentTenantIdFunctionName;
- @Valid
- @JsonProperty(value = "set_current_tenant_id_function_name")
- private StringWrapperWithNotBlankValue setCurrentTenantIdFunctionName;
- @Valid
- @JsonProperty(value = "equals_current_tenant_identifier_function_name")
- private StringWrapperWithNotBlankValue equalsCurrentTenantIdentifierFunctionName;
- @Valid
- @JsonProperty(value = "tenant_has_authorities_function_name")
- private StringWrapperWithNotBlankValue tenantHasAuthoritiesFunctionName;
- @JsonProperty(value = "force_row_level_security_for_table_owner")
- private Boolean forceRowLevelSecurityForTableOwner;
- @Valid
- @JsonProperty(value = "default_tenant_id_column")
- private StringWrapperWithNotBlankValue defaultTenantIdColumn;
- @NotBlank
- @JsonProperty(value = "grantee", required = true)
- private String grantee;
- @JsonProperty(value = "set_current_tenant_identifier_as_default_value_for_tenant_column_in_all_tables")
- private Boolean currentTenantIdentifierAsDefaultValueForTenantColumnInAllTables;
- @Valid
- @JsonProperty(value = "valid_tenant_value_constraint")
- private ValidTenantValueConstraintConfiguration validTenantValueConstraint;
- @JsonProperty(value = "tables")
- private List<@Valid TableEntry> tables;
- @Valid
- @JsonProperty(value = "sql_definitions_validation")
- private SqlDefinitionsValidation sqlDefinitionsValidation;
- @Valid
- @JsonProperty(value = "custom_sql_definitions")
- private List customSQLDefinitions;
- @JsonProperty(value = "create_foreignkey_constraint_with_tenant_column")
- private Boolean createForeignKeyConstraintWithTenantColumn;
-
- public SharedSchemaContextConfiguration setCreateForeignKeyConstraintWithTenantColumn(Boolean createForeignKeyConstraintWithTenantColumn) {
- this.createForeignKeyConstraintWithTenantColumn = createForeignKeyConstraintWithTenantColumn;
- return this;
- }
-
- public SharedSchemaContextConfiguration setCurrentTenantIdPropertyType(String currentTenantIdPropertyType) {
- this.currentTenantIdPropertyType = new StringWrapperWithNotBlankValue(currentTenantIdPropertyType);
- return this;
- }
-
- public SharedSchemaContextConfiguration setCurrentTenantIdProperty(String currentTenantIdProperty) {
- this.currentTenantIdProperty = new StringWrapperWithNotBlankValue(currentTenantIdProperty);
- return this;
- }
-
- public SharedSchemaContextConfiguration setGetCurrentTenantIdFunctionName(String getCurrentTenantIdFunctionName) {
- this.getCurrentTenantIdFunctionName = new StringWrapperWithNotBlankValue(getCurrentTenantIdFunctionName);
- return this;
- }
-
- public SharedSchemaContextConfiguration setSetCurrentTenantIdFunctionName(String setCurrentTenantIdFunctionName) {
- this.setCurrentTenantIdFunctionName = new StringWrapperWithNotBlankValue(setCurrentTenantIdFunctionName);
- return this;
- }
-
- public SharedSchemaContextConfiguration setEqualsCurrentTenantIdentifierFunctionName(String equalsCurrentTenantIdentifierFunctionName) {
- this.equalsCurrentTenantIdentifierFunctionName = new StringWrapperWithNotBlankValue(equalsCurrentTenantIdentifierFunctionName);
- return this;
- }
-
- public SharedSchemaContextConfiguration setDefaultTenantIdColumn(String defaultTenantIdColumn) {
- this.defaultTenantIdColumn = new StringWrapperWithNotBlankValue(defaultTenantIdColumn);
- return this;
- }
-
- public SharedSchemaContextConfiguration setCurrentTenantIdPropertyType(StringWrapperWithNotBlankValue currentTenantIdPropertyType) {
- this.currentTenantIdPropertyType = currentTenantIdPropertyType;
- return this;
- }
-
- public SharedSchemaContextConfiguration setCurrentTenantIdProperty(StringWrapperWithNotBlankValue currentTenantIdProperty) {
- this.currentTenantIdProperty = currentTenantIdProperty;
- return this;
- }
-
- public SharedSchemaContextConfiguration setGetCurrentTenantIdFunctionName(StringWrapperWithNotBlankValue getCurrentTenantIdFunctionName) {
- this.getCurrentTenantIdFunctionName = getCurrentTenantIdFunctionName;
- return this;
- }
-
- public SharedSchemaContextConfiguration setSetCurrentTenantIdFunctionName(StringWrapperWithNotBlankValue setCurrentTenantIdFunctionName) {
- this.setCurrentTenantIdFunctionName = setCurrentTenantIdFunctionName;
- return this;
- }
-
- public SharedSchemaContextConfiguration setEqualsCurrentTenantIdentifierFunctionName(StringWrapperWithNotBlankValue equalsCurrentTenantIdentifierFunctionName) {
- this.equalsCurrentTenantIdentifierFunctionName = equalsCurrentTenantIdentifierFunctionName;
- return this;
- }
-
- public SharedSchemaContextConfiguration setTenantHasAuthoritiesFunctionName(StringWrapperWithNotBlankValue tenantHasAuthoritiesFunctionName) {
- this.tenantHasAuthoritiesFunctionName = tenantHasAuthoritiesFunctionName;
- return this;
- }
-
- public SharedSchemaContextConfiguration setDefaultTenantIdColumn(StringWrapperWithNotBlankValue defaultTenantIdColumn) {
- this.defaultTenantIdColumn = defaultTenantIdColumn;
- return this;
- }
-
- public SharedSchemaContextConfiguration withCustomSQLDefinitions(List customSQLDefinitions) {
- this.customSQLDefinitions = customSQLDefinitions;
- return this;
- }
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/SqlDefinitionsValidation.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/SqlDefinitionsValidation.java
deleted file mode 100644
index e469bade9..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/SqlDefinitionsValidation.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Posmulten library is an open-source project for the generation
- * of SQL DDL statements that make it easy for implementation of
- * Shared Schema Multi-tenancy strategy via the Row Security
- * Policies in the Postgres database.
- *
- * Copyright (C) 2020 Szymon Tarnowski
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-package com.github.starnowski.posmulten.configuration.yaml.model;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import lombok.experimental.Accessors;
-
-import javax.validation.constraints.Min;
-
-@Accessors(chain = true)
-@Getter
-@Setter
-@EqualsAndHashCode
-@ToString
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class SqlDefinitionsValidation {
-
- @Min(1)
- @JsonProperty(value = "identifier_max_length")
- private Integer identifierMaxLength;
- @Min(1)
- @JsonProperty(value = "identifier_min_length")
- private Integer identifierMinLength;
- @JsonProperty(value = "disabled")
- private Boolean disabled;
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/StringWrapperWithNotBlankValue.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/StringWrapperWithNotBlankValue.java
deleted file mode 100644
index 9dc9a5338..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/StringWrapperWithNotBlankValue.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Posmulten library is an open-source project for the generation
- * of SQL DDL statements that make it easy for implementation of
- * Shared Schema Multi-tenancy strategy via the Row Security
- * Policies in the Postgres database.
- *
- * Copyright (C) 2020 Szymon Tarnowski
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-package com.github.starnowski.posmulten.configuration.yaml.model;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import lombok.EqualsAndHashCode;
-
-import javax.validation.constraints.NotBlank;
-
-@EqualsAndHashCode
-public final class StringWrapperWithNotBlankValue {
-
- @NotBlank
- private final String value;
-
- @JsonCreator
- public StringWrapperWithNotBlankValue(String value) {
- this.value = value;
- }
-
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return value;
- }
-
- public static StringWrapperWithNotBlankValue valueOf(String value)
- {
- return new StringWrapperWithNotBlankValue(value);
- }
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/StringWrapperWithNullValue.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/StringWrapperWithNullValue.java
deleted file mode 100644
index f223bf09c..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/StringWrapperWithNullValue.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Posmulten library is an open-source project for the generation
- * of SQL DDL statements that make it easy for implementation of
- * Shared Schema Multi-tenancy strategy via the Row Security
- * Policies in the Postgres database.
- *
- * Copyright (C) 2020 Szymon Tarnowski
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-package com.github.starnowski.posmulten.configuration.yaml.model;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import lombok.EqualsAndHashCode;
-
-@EqualsAndHashCode
-public final class StringWrapperWithNullValue {
-
- private final String value;
-
- @JsonCreator
- public StringWrapperWithNullValue(String value) {
- this.value = value;
- }
-
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return value;
- }
-
- public static StringWrapperWithNullValue valueOf(String value)
- {
- return new StringWrapperWithNullValue(value);
- }
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/TableEntry.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/TableEntry.java
deleted file mode 100644
index cc0e63430..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/TableEntry.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Posmulten library is an open-source project for the generation
- * of SQL DDL statements that make it easy for implementation of
- * Shared Schema Multi-tenancy strategy via the Row Security
- * Policies in the Postgres database.
- *
- * Copyright (C) 2020 Szymon Tarnowski
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-package com.github.starnowski.posmulten.configuration.yaml.model;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import lombok.experimental.Accessors;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotBlank;
-import java.util.List;
-import java.util.Optional;
-
-@Accessors(chain = true)
-@Getter
-@Setter
-@EqualsAndHashCode
-@ToString
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class TableEntry {
-
- /**
- * Table name
- */
- @NotBlank
- @JsonProperty(value = "name", required = true)
- private String name;
- @JsonProperty(value = "schema")
- private Optional schema;
- @Valid
- @JsonProperty(value = "rls_policy")
- private RLSPolicy rlsPolicy;
- @JsonProperty(value = "foreign_keys")
- private List<@Valid ForeignKeyConfiguration> foreignKeys;
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/ValidTenantValueConstraintConfiguration.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/ValidTenantValueConstraintConfiguration.java
deleted file mode 100644
index 6d8826af4..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/model/ValidTenantValueConstraintConfiguration.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * Posmulten library is an open-source project for the generation
- * of SQL DDL statements that make it easy for implementation of
- * Shared Schema Multi-tenancy strategy via the Row Security
- * Policies in the Postgres database.
- *
- * Copyright (C) 2020 Szymon Tarnowski
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-package com.github.starnowski.posmulten.configuration.yaml.model;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.EqualsAndHashCode;
-import lombok.Getter;
-import lombok.Setter;
-import lombok.ToString;
-import lombok.experimental.Accessors;
-
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
-import java.util.List;
-
-@Accessors(chain = true)
-@Getter
-@Setter
-@EqualsAndHashCode
-@ToString
-@JsonInclude(JsonInclude.Include.NON_NULL)
-public class ValidTenantValueConstraintConfiguration {
-
- @JsonProperty(value = "tenant_identifiers_blacklist", required = true)
- @Size(min = 1, message = "must have at least one element")
- @NotNull
- private List tenantIdentifiersBlacklist;
- @Valid
- @JsonProperty(value = "is_tenant_valid_function_name")
- private StringWrapperWithNotBlankValue isTenantValidFunctionName;
- @Valid
- @JsonProperty(value = "is_tenant_valid_constraint_name")
- private StringWrapperWithNotBlankValue isTenantValidConstraintName;
- public ValidTenantValueConstraintConfiguration setIsTenantValidFunctionName(String isTenantValidFunctionName) {
- this.isTenantValidFunctionName = new StringWrapperWithNotBlankValue(isTenantValidFunctionName);
- return this;
- }
-
- public ValidTenantValueConstraintConfiguration setIsTenantValidConstraintName(String isTenantValidConstraintName) {
- this.isTenantValidConstraintName = new StringWrapperWithNotBlankValue(isTenantValidConstraintName);
- return this;
- }
-
- public ValidTenantValueConstraintConfiguration setIsTenantValidFunctionName(StringWrapperWithNotBlankValue isTenantValidFunctionName) {
- this.isTenantValidFunctionName = isTenantValidFunctionName;
- return this;
- }
-
- public ValidTenantValueConstraintConfiguration setIsTenantValidConstraintName(StringWrapperWithNotBlankValue isTenantValidConstraintName) {
- this.isTenantValidConstraintName = isTenantValidConstraintName;
- return this;
- }
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/CustomPositionValidValue.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/CustomPositionValidValue.java
deleted file mode 100644
index 4c8fddfbb..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/CustomPositionValidValue.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Posmulten library is an open-source project for the generation
- * of SQL DDL statements that make it easy for implementation of
- * Shared Schema Multi-tenancy strategy via the Row Security
- * Policies in the Postgres database.
- *
- * Copyright (C) 2020 Szymon Tarnowski
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-package com.github.starnowski.posmulten.configuration.yaml.validation;
-
-import javax.validation.Constraint;
-import javax.validation.Payload;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Constraint(validatedBy = CustomPositionValidator.class)
-@Target(ElementType.TYPE)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface CustomPositionValidValue {
- String message() default "{error.custom.definition.custom.position.value}";
- Class>[] groups() default { };
- Class extends Payload>[] payload() default { };
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/CustomPositionValidator.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/CustomPositionValidator.java
deleted file mode 100644
index fb2cf204a..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/CustomPositionValidator.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Posmulten library is an open-source project for the generation
- * of SQL DDL statements that make it easy for implementation of
- * Shared Schema Multi-tenancy strategy via the Row Security
- * Policies in the Postgres database.
- *
- * Copyright (C) 2020 Szymon Tarnowski
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-package com.github.starnowski.posmulten.configuration.yaml.validation;
-
-import com.github.starnowski.posmulten.configuration.yaml.model.CustomDefinitionEntry;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-
-public class CustomPositionValidator implements ConstraintValidator {
- @Override
- public boolean isValid(CustomDefinitionEntry customDefinitionEntry, ConstraintValidatorContext constraintValidatorContext) {
- if (customDefinitionEntry.getPosition() == null) {
- return true;
- }
- boolean result = true;
- switch (customDefinitionEntry.getPosition()) {
- case AT_END:
- case AT_BEGINNING:
- result = true;
- break;
- case CUSTOM:
- result = customDefinitionEntry.getCustomPosition() != null && !customDefinitionEntry.getCustomPosition().trim().isEmpty();
- }
- return result;
- }
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/EnumNamePattern.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/EnumNamePattern.java
deleted file mode 100644
index 6831c8a7c..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/EnumNamePattern.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Posmulten library is an open-source project for the generation
- * of SQL DDL statements that make it easy for implementation of
- * Shared Schema Multi-tenancy strategy via the Row Security
- * Policies in the Postgres database.
- *
- * Copyright (C) 2020 Szymon Tarnowski
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-package com.github.starnowski.posmulten.configuration.yaml.validation;
-
-import javax.validation.Constraint;
-import javax.validation.Payload;
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-/**
- * Implementation used code from article https://www.baeldung.com/javax-validations-enums
- */
-@Target({FIELD})
-@Retention(RUNTIME)
-@Documented
-@Constraint(validatedBy = EnumNamePatternValidator.class)
-public @interface EnumNamePattern {
-
- Class extends java.lang.Enum> enumType();
-
- String message() default "{error.enum.values}";
-
- Class>[] groups() default {};
-
- Class extends Payload>[] payload() default {};
-}
\ No newline at end of file
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/EnumNamePatternValidator.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/EnumNamePatternValidator.java
deleted file mode 100644
index a89934607..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/EnumNamePatternValidator.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Posmulten library is an open-source project for the generation
- * of SQL DDL statements that make it easy for implementation of
- * Shared Schema Multi-tenancy strategy via the Row Security
- * Policies in the Postgres database.
- *
- * Copyright (C) 2020 Szymon Tarnowski
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
- * USA
- */
-package com.github.starnowski.posmulten.configuration.yaml.validation;
-
-import org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext;
-
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-public class EnumNamePatternValidator implements ConstraintValidator {
-
- private Class extends Enum> enumClass;
-
- @Override
- public void initialize(EnumNamePattern constraintAnnotation) {
- this.enumClass = constraintAnnotation.enumType();
- }
-
- @Override
- public boolean isValid(String value, ConstraintValidatorContext constraintValidatorContext) {
- if (value == null) {
- return true;
- }
- if (Stream.of(this.enumClass.getEnumConstants()).map(e -> ((Enum) e).name()).noneMatch(name -> name.equals(value))) {
- HibernateConstraintValidatorContext hibernateContext = constraintValidatorContext.unwrap(
- HibernateConstraintValidatorContext.class );
- hibernateContext.addExpressionVariable("enumValues", Stream.of(this.enumClass.getEnumConstants()).map(e -> ((Enum) e).name()).collect(Collectors.joining(", ")));
- return false;
- }
- return true;
- }
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/groups/NameForFunctionThatChecksIfRecordExistsInTableNotBlankGroupResolver.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/groups/NameForFunctionThatChecksIfRecordExistsInTableNotBlankGroupResolver.java
deleted file mode 100644
index 2341a6c3a..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/groups/NameForFunctionThatChecksIfRecordExistsInTableNotBlankGroupResolver.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.github.starnowski.posmulten.configuration.yaml.validation.groups;
-
-import com.github.starnowski.posmulten.configuration.yaml.model.PrimaryKeyDefinition;
-import com.github.starnowski.posmulten.configuration.yaml.model.SharedSchemaContextConfiguration;
-
-public class NameForFunctionThatChecksIfRecordExistsInTableNotBlankGroupResolver implements ValidatorGroupResolver {
-
-
- @Override
- public Class resolveForSharedSchemaContextConfiguration(SharedSchemaContextConfiguration sharedSchemaContextConfiguration, ValidatorGroupResolverContext context) {
- return Boolean.TRUE.equals(sharedSchemaContextConfiguration.getCreateForeignKeyConstraintWithTenantColumn()) ? null : PrimaryKeyDefinition.NameForFunctionThatChecksIfRecordExistsInTableNotBlank.class;
- }
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/groups/ValidatorGroupResolver.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/groups/ValidatorGroupResolver.java
deleted file mode 100644
index 3fa09ead2..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/groups/ValidatorGroupResolver.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.github.starnowski.posmulten.configuration.yaml.validation.groups;
-
-import com.github.starnowski.posmulten.configuration.yaml.model.SharedSchemaContextConfiguration;
-
-public interface ValidatorGroupResolver {
-
- Class resolveForSharedSchemaContextConfiguration(SharedSchemaContextConfiguration sharedSchemaContextConfiguration, ValidatorGroupResolverContext context);
-
- interface ValidatorGroupResolverContext {
-
- }
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/groups/ValidatorGroupsResolver.java b/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/groups/ValidatorGroupsResolver.java
deleted file mode 100644
index cef73d0c5..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/java/com/github/starnowski/posmulten/configuration/yaml/validation/groups/ValidatorGroupsResolver.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.github.starnowski.posmulten.configuration.yaml.validation.groups;
-
-import com.github.starnowski.posmulten.configuration.yaml.model.SharedSchemaContextConfiguration;
-
-import java.util.Collections;
-import java.util.List;
-
-import static java.util.stream.Collectors.toList;
-
-public class ValidatorGroupsResolver {
-
- private final List validatorGroupResolvers;
-
- public ValidatorGroupsResolver() {
- this(Collections.singletonList(new NameForFunctionThatChecksIfRecordExistsInTableNotBlankGroupResolver()));
- }
-
- public ValidatorGroupsResolver(List validatorGroupResolvers) {
- this.validatorGroupResolvers = validatorGroupResolvers;
- }
-
- List getValidatorGroupResolvers() {
- return validatorGroupResolvers;
- }
-
- public List resolveForSharedSchemaContextConfiguration(SharedSchemaContextConfiguration sharedSchemaContextConfiguration, ValidatorGroupResolver.ValidatorGroupResolverContext validatorGroupResolverContext) {
- return validatorGroupResolvers.stream().map(resolver -> resolver.resolveForSharedSchemaContextConfiguration(sharedSchemaContextConfiguration, validatorGroupResolverContext)).collect(toList());
- }
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/main/resources/ValidationMessages.properties b/configuration-parent/configuration-yaml-interpreter/src/main/resources/ValidationMessages.properties
deleted file mode 100644
index f1270f685..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/main/resources/ValidationMessages.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-error.custom.definition.custom.position.value=for definition with position 'CUSTOM' the property 'custom_position' is required
-error.enum.values=available values are ${enumValues}
\ No newline at end of file
diff --git a/configuration-parent/configuration-yaml-interpreter/src/test/groovy/com/github/starnowski/posmulten/configuration/yaml/AbstractSpecification.groovy b/configuration-parent/configuration-yaml-interpreter/src/test/groovy/com/github/starnowski/posmulten/configuration/yaml/AbstractSpecification.groovy
deleted file mode 100644
index d22aff212..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/test/groovy/com/github/starnowski/posmulten/configuration/yaml/AbstractSpecification.groovy
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.github.starnowski.posmulten.configuration.yaml
-
-import java.nio.file.Paths
-
-abstract class AbstractSpecification extends spock.lang.Specification {
-
- protected String resolveFilePath(String filePath) {
- Paths.get(this.class.getResource(filePath).toURI()).toFile().getPath()
- }
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/test/groovy/com/github/starnowski/posmulten/configuration/yaml/context/YamlConfigurationDefaultSharedSchemaContextBuilderFactorySupplierTest.groovy b/configuration-parent/configuration-yaml-interpreter/src/test/groovy/com/github/starnowski/posmulten/configuration/yaml/context/YamlConfigurationDefaultSharedSchemaContextBuilderFactorySupplierTest.groovy
deleted file mode 100644
index 7eabd8cf0..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/test/groovy/com/github/starnowski/posmulten/configuration/yaml/context/YamlConfigurationDefaultSharedSchemaContextBuilderFactorySupplierTest.groovy
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.github.starnowski.posmulten.configuration.yaml.context
-
-import spock.lang.Specification
-
-import static java.util.Arrays.asList
-
-class YamlConfigurationDefaultSharedSchemaContextBuilderFactorySupplierTest extends Specification {
-
- def tested = new YamlConfigurationDefaultSharedSchemaContextBuilderFactorySupplier()
-
- def "should return priority with value zero"()
- {
- expect:
- tested.getPriority() == 0
- }
-
- def "should return extensions related to YAML language"()
- {
- given:
- def expectedExtensions = asList("yaml", "yml")
-
- when:
- def results = tested.getSupportedFileExtensions()
-
- then:
- results
- results.size() == expectedExtensions.size()
- results.containsAll(expectedExtensions)
- }
-
- def "should return factory supplier"()
- {
- when:
- def supplier = tested.getFactorySupplier()
-
- then:
- supplier
-
- and: "supplier creates object of correct type"
- YamlConfigurationDefaultSharedSchemaContextBuilderFactory.class.equals(supplier.get().getClass())
- }
-}
diff --git a/configuration-parent/configuration-yaml-interpreter/src/test/groovy/com/github/starnowski/posmulten/configuration/yaml/context/YamlConfigurationDefaultSharedSchemaContextBuilderFactoryTest.groovy b/configuration-parent/configuration-yaml-interpreter/src/test/groovy/com/github/starnowski/posmulten/configuration/yaml/context/YamlConfigurationDefaultSharedSchemaContextBuilderFactoryTest.groovy
deleted file mode 100644
index 04722ac77..000000000
--- a/configuration-parent/configuration-yaml-interpreter/src/test/groovy/com/github/starnowski/posmulten/configuration/yaml/context/YamlConfigurationDefaultSharedSchemaContextBuilderFactoryTest.groovy
+++ /dev/null
@@ -1,130 +0,0 @@
-package com.github.starnowski.posmulten.configuration.yaml.context
-
-import com.github.starnowski.posmulten.configuration.yaml.AbstractSpecification
-import com.github.starnowski.posmulten.configuration.yaml.exceptions.YamlInvalidSchema
-import spock.lang.Unroll
-
-import java.nio.file.Files
-import java.nio.file.Paths
-
-import static com.github.starnowski.posmulten.configuration.yaml.TestProperties.ALL_FIELDS_FILE_PATH
-import static com.github.starnowski.posmulten.configuration.yaml.TestProperties.INVALID_LIST_NODES_BLANK_FIELDS_PATH
-import static com.github.starnowski.posmulten.configuration.yaml.TestProperties.INVALID_MAP_BLANK_FIELDS_PATH
-import static com.github.starnowski.posmulten.configuration.yaml.TestProperties.INVALID_NESTED_NODE_BLANK_FIELDS_FILE_PATH
-import static com.github.starnowski.posmulten.configuration.yaml.TestProperties.INVALID_NESTED_NODE_EMPTY_LIST_FILE_PATH
-import static com.github.starnowski.posmulten.configuration.yaml.TestProperties.INVALID_ROOT_NODE_BLANK_FIELDS_FILE_PATH
-import static com.github.starnowski.posmulten.configuration.yaml.TestProperties.ONLY_MANDATORY_FIELDS_FILE_PATH
-import static com.github.starnowski.posmulten.configuration.yaml.TestProperties.MANY_TO_MANY_TABLES_FILE_PATH
-import static com.github.starnowski.posmulten.configuration.yaml.TestProperties.DISABLED_SQL_DEFINITIONS_VALIDATION_FILE_PATH
-import static com.github.starnowski.posmulten.configuration.yaml.TestProperties.SQL_DEFINITIONS_VALIDATION_WITH_CUSTOM_CONSTRAINTS_FILE_PATH
-import static com.github.starnowski.posmulten.configuration.yaml.TestProperties.SQL_DEFINITIONS_VALIDATION_WITH_INVALID_CONSTRAINTS_PATH
-import static com.github.starnowski.posmulten.configuration.yaml.TestProperties.SQL_DEFINITIONS_VALIDATION_WITH_NULL_VALUES_PATH
-
-class YamlConfigurationDefaultSharedSchemaContextBuilderFactoryTest extends AbstractSpecification {
-
- def tested = new YamlConfigurationDefaultSharedSchemaContextBuilderFactory()
-
- @Unroll
- def "should create builder component based on file #filePath"()
- {
- given:
- def resolvedPath = resolveFilePath(filePath)
-
- when:
- def builder = tested.build(resolvedPath)
-
- then:
- builder
-
- and: "builder should return a non-empty list of DDL statements"
- !builder.build().getSqlDefinitions().isEmpty()
-
- where:
- filePath << [ALL_FIELDS_FILE_PATH, ONLY_MANDATORY_FIELDS_FILE_PATH, MANY_TO_MANY_TABLES_FILE_PATH, DISABLED_SQL_DEFINITIONS_VALIDATION_FILE_PATH, SQL_DEFINITIONS_VALIDATION_WITH_CUSTOM_CONSTRAINTS_FILE_PATH, SQL_DEFINITIONS_VALIDATION_WITH_NULL_VALUES_PATH]
- }
-
- @Unroll
- def "should throw exception that contains error message (#errorMessage) for file #filePath"()
- {
- given:
- def resolvedPath = resolveFilePath(filePath)
-
- when:
- tested.build(resolvedPath)
-
- then:
- def ex = thrown(YamlInvalidSchema)
- ex
- ex.getErrorMessages().contains(errorMessage)
-
- where:
- filePath || errorMessage
- INVALID_ROOT_NODE_BLANK_FIELDS_FILE_PATH || "grantee must not be blank"
- INVALID_ROOT_NODE_BLANK_FIELDS_FILE_PATH || "equals_current_tenant_identifier_function_name must not be blank"
- INVALID_NESTED_NODE_BLANK_FIELDS_FILE_PATH || "valid_tenant_value_constraint.is_tenant_valid_function_name must not be blank"
- INVALID_NESTED_NODE_BLANK_FIELDS_FILE_PATH || "valid_tenant_value_constraint.tenant_identifiers_blacklist must not be null"
- INVALID_NESTED_NODE_EMPTY_LIST_FILE_PATH || "valid_tenant_value_constraint.tenant_identifiers_blacklist must have at least one element"
- INVALID_LIST_NODES_BLANK_FIELDS_PATH || "tables[3].rls_policy.primary_key_definition.name_for_function_that_checks_if_record_exists_in_table must not be blank"
- INVALID_LIST_NODES_BLANK_FIELDS_PATH || "tables[0].name must not be blank"
- INVALID_MAP_BLANK_FIELDS_PATH || "tables[0].foreign_keys[0].foreign_key_primary_key_columns_mappings must have at least one element"
- INVALID_MAP_BLANK_FIELDS_PATH || "tables[2].foreign_keys[2].foreign_key_primary_key_columns_mappings.