Class EmbeddedPostgres
java.lang.Object
com.opentable.db.postgres.embedded.EmbeddedPostgres
- All Implemented Interfaces:
Closeable
,AutoCloseable
Core class of the library, providing a builder (with reasonable defaults) to wrap
testcontainers and launch postgres container.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic EmbeddedPostgres.Builder
builder()
void
close()
getDatabase
(String userName, String dbName) getHost()
getJdbcUrl
(String dbName) Returns JDBC connection string for specified databaseint
getPort()
getPostgresDatabase
(Map<String, String> properties) getTemplateDatabase
(Map<String, String> properties) static EmbeddedPostgres
start()
toString()
-
Method Details
-
getTemplateDatabase
-
getTemplateDatabase
-
getPostgresDatabase
-
getPostgresDatabase
-
getDatabase
-
getDatabase
-
getJdbcUrl
Returns JDBC connection string for specified database- Parameters:
dbName
- Database name- Returns:
- URL
-
getHost
-
getPort
public int getPort() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
start
- Throws:
IOException
-
builder
-
getUserName
-
getPassword
-
toString
-