Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Commit

Permalink
Merge pull request #800 from CJSCommonPlatform/add-file-service-test-…
Browse files Browse the repository at this point in the history
…datasource

Add get file-service datasource to TestJdbcDataSourceProvider
  • Loading branch information
allanmckenzie committed Apr 9, 2020
2 parents 3e85660 + a47f2f4 commit 2c9fbc5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ before_script:
- psql -c 'create database frameworkviewstore;' -U postgres
- psql -c 'create database frameworkfilestore;' -U postgres
- psql -c 'create database frameworksystem;' -U postgres
- psql -c 'create database fileservice;' -U postgres
- psql -c "CREATE USER framework WITH PASSWORD 'framework';" -U postgres
- psql -c "CREATE USER fileservice WITH PASSWORD 'fileservice';" -U postgres
addons:
postgresql: "9.5"
sonarcloud:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on [Keep a CHANGELOG](http://keepachangelog.com/). This project adheres to
[Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
- Added get file-service datasource to TestJdbcDataSourceProvider

## [6.5.0-M5] - 2019-12-17
- Update framework-api to 4.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public DataSource getSystemDataSource(final String contextName) {

}

public DataSource getFileServiceDataSource() {
return getDataSource("fileservice", "fileservice");
}

private DataSource getDataSource(final String contextName, final String databaseName) {

final PGSimpleDataSource dataSource = new PGSimpleDataSource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void shouldGetADataSourceToTheEventStore() throws Exception {
assertThat(connection.isClosed(), is(false));
}
}

@Test
public void shouldGetADataSourceToSystem() throws Exception {

Expand All @@ -46,4 +47,14 @@ public void shouldGetADataSourceToSystem() throws Exception {
assertThat(connection.isClosed(), is(false));
}
}

@Test
public void shouldGetDataSourceToFileService() throws Exception {

final DataSource dataSource = testJdbcDataSourceProvider.getFileServiceDataSource();

try(final Connection connection = dataSource.getConnection()) {
assertThat(connection.isClosed(), is(false));
}
}
}

0 comments on commit 2c9fbc5

Please sign in to comment.