Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pikolinianita/0718608f53a0e92dc541048b0e59e72e to your computer and use it in GitHub Desktop.
Save pikolinianita/0718608f53a0e92dc541048b0e59e72e to your computer and use it in GitHub Desktop.
//Klasa z konfiguracjami Test-Kontenerów
@TestConfiguration(proxyBeanMethods = false)
class TestContainerConfiguration {
@Bean
@ServiceConnection
PostgreSQLContainer<?> postgresContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:17"));
}
}
//Uruchomienie aplikacji z Test-kontenerami
public class TestCoursesRun {
public static void main(String[] args) {
SpringApplication.from(CoursesPlatformApplication::main)
.with(TestContainerConfiguration.class)
.run(args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment