}
protected static void doCommonAssembling( ModuleAssembly mainModule )
throws AssemblyException
{
ModuleAssembly config = mainModule.layer().module( "config" );
new EntityTestAssembler().assemble( config );
// START SNIPPET: assembly
// DataSourceService
new DBCPDataSourceServiceAssembler().
identifiedBy( "postgres-datasource-service" ).
visibleIn( Visibility.module ).
withConfig( config, Visibility.layer ).
assemble( mainModule );
// DataSource
new DataSourceAssembler().
withDataSourceServiceIdentity( "postgres-datasource-service" ).
identifiedBy( "postgres-datasource" ).
visibleIn( Visibility.module ).
withCircuitBreaker().
assemble( mainModule );
// SQL Index/Query
new PostgreSQLIndexQueryAssembler().
visibleIn( Visibility.module ).
withConfig( config, Visibility.layer ).
assemble( mainModule );
// END SNIPPET: assembly
// Always re-build schema in test scenarios because of possibly different app structure in
// various tests
mainModule.services( RebuildingStrategy.class ).
withMixins( RebuildingStrategy.AlwaysNeed.class ).
visibleIn( Visibility.module );
// Always re-index in test scenarios
mainModule.services( ReindexingStrategy.class ).
withMixins( ReindexingStrategy.AlwaysNeed.class ).
visibleIn( Visibility.module );
config.entities( ReindexerConfiguration.class ).
visibleIn( Visibility.layer );
}