Skip to content

Commit 9dcf003

Browse files
committed
Polish PostgresMlEmbeddingModelIT
1 parent 6307377 commit 9dcf003

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

models/spring-ai-postgresml/src/test/java/org/springframework/ai/postgresml/PostgresMlEmbeddingModelIT.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.ai.postgresml;
1818

19-
import java.time.Duration;
20-
import java.time.temporal.ChronoUnit;
2119
import java.util.List;
2220
import java.util.Map;
2321

@@ -28,7 +26,7 @@
2826
import org.junit.jupiter.params.ParameterizedTest;
2927
import org.junit.jupiter.params.provider.ValueSource;
3028
import org.testcontainers.containers.PostgreSQLContainer;
31-
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
29+
import org.testcontainers.containers.wait.strategy.Wait;
3230
import org.testcontainers.junit.jupiter.Container;
3331
import org.testcontainers.junit.jupiter.Testcontainers;
3432
import org.testcontainers.utility.DockerImageName;
@@ -51,6 +49,7 @@
5149

5250
/**
5351
* @author Toshiaki Maki
52+
* @author Eddú Meléndez
5453
*/
5554
@JdbcTest(properties = "logging.level.sql=TRACE")
5655
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@@ -63,12 +62,10 @@ class PostgresMlEmbeddingModelIT {
6362
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>(
6463
DockerImageName.parse("ghcr.io/postgresml/postgresml:2.8.1").asCompatibleSubstituteFor("postgres"))
6564
.withCommand("sleep", "infinity")
66-
.withLabel("org.springframework.boot.service-connection", "postgres")
6765
.withUsername("postgresml")
6866
.withPassword("postgresml")
6967
.withDatabaseName("postgresml")
70-
.waitingFor(new LogMessageWaitStrategy().withRegEx(".*Starting dashboard.*\\s")
71-
.withStartupTimeout(Duration.of(60, ChronoUnit.SECONDS)));
68+
.waitingFor(Wait.forLogMessage(".*Starting dashboard.*\\s", 1));
7269

7370
@Autowired
7471
JdbcTemplate jdbcTemplate;

0 commit comments

Comments
 (0)