-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#294 - Added second generic mapper test
- Loading branch information
1 parent
0d56a63
commit c774003
Showing
3 changed files
with
58 additions
and
44 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
...multen/configuration/common/yaml/mappers/AbstractForeignKeyConfigurationMapperTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package com.github.starnowski.posmulten.configuration.common.yaml.mappers | ||
|
||
import com.github.starnowski.posmulten.configuration.core.model.ForeignKeyConfiguration | ||
import com.github.starnowski.posmulten.configuration.yaml.core.IConfigurationMapper | ||
import com.github.starnowski.posmulten.configuration.yaml.core.model.AbstractForeignKeyConfiguration | ||
|
||
import static com.github.starnowski.posmulten.postgresql.test.utils.MapBuilder.mapBuilder | ||
|
||
abstract class AbstractForeignKeyConfigurationMapperTest <T extends AbstractForeignKeyConfiguration<T>, M extends IConfigurationMapper<ForeignKeyConfiguration, T>, CMTC extends AbstractConfigurationMapperTestContext> extends AbstractConfigurationMapperTest<T, ForeignKeyConfiguration, M, CMTC> { | ||
|
||
@Override | ||
protected Class<ForeignKeyConfiguration> getConfigurationObjectClass() { | ||
ForeignKeyConfiguration.class | ||
} | ||
|
||
protected abstract T createOutputInstance(); | ||
|
||
@Override | ||
protected List<T> prepareExpectedMappedObjectsList() { | ||
[ | ||
createOutputInstance(), | ||
createOutputInstance(), | ||
createOutputInstance().setConstraintName("asfxzvz") | ||
.setTableName("ccc"), | ||
createOutputInstance().setConstraintName("fk_constraint") | ||
.setTableName("some_table") | ||
.setForeignKeyPrimaryKeyColumnsMappings(mapBuilder().put("user_id", "id").build()), | ||
createOutputInstance().setConstraintName("users_fk") | ||
.setTableName("users_po_table") | ||
.setForeignKeyPrimaryKeyColumnsMappings(mapBuilder().put("sss", "uuid").put("some_id", "primary_key_col_id").build()) | ||
] | ||
} | ||
|
||
@Override | ||
protected List<ForeignKeyConfiguration> prepareExpectedUnmappeddObjectsList() { | ||
[ | ||
new ForeignKeyConfiguration(), | ||
new ForeignKeyConfiguration().setConstraintName(null) | ||
.setTableName(null), | ||
new ForeignKeyConfiguration().setConstraintName("asfxzvz") | ||
.setTableName("ccc"), | ||
new ForeignKeyConfiguration().setConstraintName("fk_constraint") | ||
.setTableName("some_table") | ||
.setForeignKeyPrimaryKeyColumnsMappings(mapBuilder().put("user_id", "id").build()), | ||
new ForeignKeyConfiguration().setConstraintName("users_fk") | ||
.setTableName("users_po_table") | ||
.setForeignKeyPrimaryKeyColumnsMappings(mapBuilder().put("sss", "uuid").put("some_id", "primary_key_col_id").build()) | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters