Skip to content

Commit

Permalink
#301 - Added implementation for builder
Browse files Browse the repository at this point in the history
  • Loading branch information
starnowski committed Mar 5, 2024
1 parent 37e4af4 commit 16f47d9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public DefaultSharedSchemaContextBuilder enrich(DefaultSharedSchemaContextBuilde
if (contextConfiguration.getCurrentTenantIdentifierAsDefaultValueForTenantColumnInAllTables() != null) {
builder.setCurrentTenantIdentifierAsDefaultValueForTenantColumnInAllTables(contextConfiguration.getCurrentTenantIdentifierAsDefaultValueForTenantColumnInAllTables());
}
builder.setCreateForeignKeyConstraintWithTenantColumn(contextConfiguration.getCreateForeignKeyConstraintWithTenantColumn());
validTenantValueConstraintConfigurationEnricher.enrich(builder, contextConfiguration.getValidTenantValueConstraint());
tablesEntriesEnricher.enrich(builder, contextConfiguration.getTables());
sqlDefinitionsValidationEnricher.enrich(builder, contextConfiguration.getSqlDefinitionsValidation());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,22 @@ class DefaultSharedSchemaContextBuilderConfigurationEnricherTest extends Abstrac
result == builder
1 * customDefinitionEntriesEnricher.enrich(builder, customDefinitions)
}
@Unroll
def "should set builder component with specific property createForeignKeyConstraintWithTenantColumn with value #createForeignKeyConstraintWithTenantColumn"()
{
given:
def builder = prepareBuilderMockWithZeroExpectationOfMethodsInvocation()
def configuration = new SharedSchemaContextConfiguration().setCreateForeignKeyConstraintWithTenantColumn(createForeignKeyConstraintWithTenantColumn)
when:
def result = tested.enrich(builder, configuration)
then:
result == builder
1 * builder.setCreateForeignKeyConstraintWithTenantColumn(createForeignKeyConstraintWithTenantColumn)
where:
createForeignKeyConstraintWithTenantColumn << [null, false, true]
}
}

0 comments on commit 16f47d9

Please sign in to comment.