Skip to content

Commit

Permalink
feat: using postgres testcontainer for junits
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Oct 5, 2023
1 parent d498005 commit e3b4a18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/boot-jpa-hibernate2ndlevelcache-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
java-version: 21
distribution: "zulu"
cache: "maven"
- name: Start up redis & postgres via Docker Compose
- name: Start up redis via Docker Compose
run: |
cd docker
docker compose up -d postgresqldb redis
docker compose up -d redis
sleep 5
docker ps -a
- name: Build and analyze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@TestConfiguration(proxyBeanMethods = false)
@ImportTestcontainers(TestContainersConfig.class)
class TestApplication {
public class TestApplication {

public static void main(String[] args) {
SpringApplication.from(Application::main).with(TestApplication.class).run(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static com.example.hibernatecache.utils.AppConstants.PROFILE_TEST;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;

import com.example.hibernatecache.TestApplication;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
Expand All @@ -11,7 +12,7 @@
import org.springframework.test.web.servlet.MockMvc;

@ActiveProfiles({PROFILE_TEST})
@SpringBootTest(webEnvironment = RANDOM_PORT)
@SpringBootTest(webEnvironment = RANDOM_PORT, classes = TestApplication.class)
@AutoConfigureMockMvc
public abstract class AbstractIntegrationTest {

Expand Down

0 comments on commit e3b4a18

Please sign in to comment.