Skip to content

Commit

Permalink
Test works locally
Browse files Browse the repository at this point in the history
  • Loading branch information
seraphinandrieux committed Jun 7, 2022
1 parent 094fbf1 commit 2a82bb9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public static Map<String, Object> springProperties(String baseName) {
public static Map<String, Object> springPropertiesForTest(String baseName) {
TreeMap<String, Object> result = new TreeMap<>();
result.put("spring.datasource.driver-class-name", "org.testcontainers.jdbc.ContainerDatabaseDriver");
result.put("spring.datasource.url", "jdbc:tc:sqlserver:latest:///;database=" + baseName + ";trustServerCertificate=true;");
result.put(
"spring.datasource.url",
"jdbc:tc:sqlserver:latest://;database=" + baseName + ";trustServerCertificate=true?TC_TMPFS=/testtmpfs:rw"
);
result.put("spring.datasource.username", "SA");
result.put("spring.datasource.password", "yourStrong(!)Password");
result.put("spring.datasource.hikari.maximum-pool-size", 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private void assertTestContainersWasAdded(Project project) {
assertFileContent(
project,
getPath(TEST_RESOURCES, "config/application.properties"),
"spring.datasource.url=jdbc:tc:sqlserver:latest:///;database=jhipster;trustServerCertificate=true;"
"spring.datasource.url=jdbc:tc:sqlserver:latest://;database=jhipster;trustServerCertificate=true?TC_TMPFS=/testtmpfs:rw"
);
assertFileExist(project, "src/test/resources/container-license-acceptance.txt");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ void shouldGetSpringPropertiesForTest() {

assertThat(springProperties)
.containsEntry("spring.datasource.driver-class-name", "org.testcontainers.jdbc.ContainerDatabaseDriver")
.containsEntry("spring.datasource.url", "jdbc:tc:sqlserver:latest:///;database=baseName;trustServerCertificate=true;")
.containsEntry(
"spring.datasource.url",
"jdbc:tc:sqlserver:latest://;database=baseName;trustServerCertificate=true?TC_TMPFS=/testtmpfs:rw"
)
.containsEntry("spring.datasource.username", "SA")
.containsEntry("spring.datasource.password", "yourStrong(!)Password")
.containsEntry("spring.datasource.hikari.maximum-pool-size", 2);
Expand Down

0 comments on commit 2a82bb9

Please sign in to comment.