Skip to content

Commit

Permalink
Merge branch 'main' into inventory-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli authored Nov 18, 2024
2 parents fc94d07 + dd6378f commit 9d10d66
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Licensed under MIT License Copyright (c) 2023-2024 Raja Kolli.

package com.example.inventoryservice;

import com.example.inventoryservice.config.NonSQLContainersConfig;
import com.example.inventoryservice.config.SQLContainersConfig;
import com.example.inventoryservice.utils.AppConstants;
import com.example.inventoryservice.common.SQLContainersConfig;
import com.example.inventoryservice.config.NonSQLContainersConfig;
import org.springframework.boot.SpringApplication;

public class TestInventoryApplication {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ Licensed under MIT License Copyright (c) 2021-2024 Raja Kolli.
import static com.example.inventoryservice.utils.AppConstants.PROFILE_TEST;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;

import com.example.inventoryservice.TestInventoryApplication;
import com.example.inventoryservice.config.NonSQLContainersConfig;
import com.example.inventoryservice.config.SQLContainersConfig;
import com.example.inventoryservice.config.TestStockOrderListenerConfig;
import com.example.inventoryservice.repositories.InventoryRepository;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand All @@ -26,10 +24,9 @@ Licensed under MIT License Copyright (c) 2021-2024 Raja Kolli.
@SpringBootTest(
webEnvironment = RANDOM_PORT,
classes = {
TestInventoryApplication.class,
TestStockOrderListenerConfig.class,
SQLContainersConfig.class,
NonSQLContainersConfig.class,
SQLContainersConfig.class
TestStockOrderListenerConfig.class
})
@AutoConfigureMockMvc
public abstract class AbstractIntegrationTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/***
<p>
Licensed under MIT License Copyright (c) 2023 Raja Kolli.
</p>
***/

package com.example.inventoryservice.common;

import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.utility.DockerImageName;

@TestConfiguration(proxyBeanMethods = false)
public class SQLContainersConfig {

@Bean
@ServiceConnection
PostgreSQLContainer<?> postgreSQLContainer() {
return new PostgreSQLContainer<>(DockerImageName.parse("postgres:17-alpine"))
.withReuse(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Licensed under MIT License Copyright (c) 2023 Raja Kolli.

import static org.assertj.core.api.Assertions.assertThat;

import com.example.inventoryservice.config.SQLContainersConfig;
import com.example.inventoryservice.common.SQLContainersConfig;
import com.zaxxer.hikari.HikariDataSource;
import javax.sql.DataSource;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Licensed under MIT License Copyright (c) 2023 Raja Kolli.
import static com.example.inventoryservice.jooq.tables.Inventory.INVENTORY;
import static org.assertj.core.api.Assertions.assertThat;

import com.example.inventoryservice.config.SQLContainersConfig;
import com.example.inventoryservice.common.SQLContainersConfig;
import com.example.inventoryservice.entities.Inventory;
import java.util.List;
import org.jooq.DSLContext;
Expand Down

0 comments on commit 9d10d66

Please sign in to comment.