Spring Boot - Testing Spring Boot Applications
Given this Spring Boot test snippet using Testcontainers:
What will
@Testcontainers
class MyRepositoryTest {
@Container
static PostgreSQLContainer> postgres = new PostgreSQLContainer<>("postgres:13").withDatabaseName("testdb").withUsername("user").withPassword("pass");
@Autowired
MyRepository repo;
@Test
void testCount() {
long count = repo.count();
System.out.println(count);
}
}What will
System.out.println(count); print if the database is empty?