project init

This commit is contained in:
sechmachine
2026-08-14 04:15:52 +07:00
parent 55fc1d2d87
commit 55a8ce675f
15 changed files with 808 additions and 20 deletions
@@ -0,0 +1,15 @@
package com.lab.labtimesheet;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Import;
@Import(TestcontainersConfiguration.class)
@SpringBootTest
class LabtimesheetApplicationTests {
@Test
void contextLoads() {
}
}
@@ -0,0 +1,11 @@
package com.lab.labtimesheet;
import org.springframework.boot.SpringApplication;
public class TestLabtimesheetApplication {
public static void main(String[] args) {
SpringApplication.from(LabtimesheetApplication::main).with(TestcontainersConfiguration.class).run(args);
}
}
@@ -0,0 +1,18 @@
package com.lab.labtimesheet;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.postgresql.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;
@TestConfiguration(proxyBeanMethods = false)
class TestcontainersConfiguration {
@Bean
@ServiceConnection
PostgreSQLContainer postgresContainer() {
return new PostgreSQLContainer(DockerImageName.parse("postgres:latest"));
}
}