diff --git a/data/generators/brand_generator.py b/data/generators/brand_generator.py index f22e1a8a..9b015b98 100644 --- a/data/generators/brand_generator.py +++ b/data/generators/brand_generator.py @@ -253,43 +253,33 @@ def generate_brand_sponsors(self): print(f"\n[브랜드 협찬] 브랜드 협찬 상품 생성 중...") with self.connection.cursor() as cursor: - cursor.execute("SELECT id FROM campaign") - campaign_ids = [row['id'] for row in cursor.fetchall()] - cursor.execute("SELECT id FROM brand") brand_ids = [row['id'] for row in cursor.fetchall()] - if not campaign_ids or not brand_ids: - print("[경고] 캠페인 또는 브랜드가 없습니다.") + if not brand_ids: + print("[경고] 브랜드가 없습니다.") return sponsors = [] - for campaign_id in campaign_ids: - # 각 캠페인당 1~3개의 협찬 상품 생성 + for brand_id in brand_ids: + # 각 브랜드당 1~3개의 협찬 상품 생성 num_sponsors = self.fake.random_int(1, 3) - brand_id = self.fake.random_element(brand_ids) for _ in range(num_sponsors): - total_count = self.fake.random_int(5, 20) - current_count = self.fake.random_int(0, total_count) - sponsors.append({ - 'campaign_id': campaign_id, 'brand_id': brand_id, 'name': random.choice(self.SPONSOR_NAMES), 'content': random.choice(self.SPONSOR_CONTENTS), - 'total_count': total_count, - 'current_count': current_count, 'is_deleted': False, 'created_at': datetime.now() - timedelta(days=self.fake.random_int(0, 30)), 'updated_at': datetime.now() }) sql = """ - INSERT INTO brand_available_sponsor (campaign_id, brand_id, name, content, - total_count, current_count, is_deleted, created_at, updated_at) - VALUES (%(campaign_id)s, %(brand_id)s, %(name)s, %(content)s, - %(total_count)s, %(current_count)s, %(is_deleted)s, %(created_at)s, %(updated_at)s) + INSERT INTO brand_available_sponsor (brand_id, name, content, + is_deleted, created_at, updated_at) + VALUES (%(brand_id)s, %(name)s, %(content)s, + %(is_deleted)s, %(created_at)s, %(updated_at)s) """ self.execute_many(sql, sponsors, "브랜드 협찬 상품") diff --git a/data/migrations/2026-02-11_merge_sponsor_info_into_available_sponsor.sql b/data/migrations/2026-02-11_merge_sponsor_info_into_available_sponsor.sql new file mode 100644 index 00000000..75476391 --- /dev/null +++ b/data/migrations/2026-02-11_merge_sponsor_info_into_available_sponsor.sql @@ -0,0 +1,22 @@ +ALTER TABLE brand_available_sponsor + ADD COLUMN shipping_type VARCHAR(50) NULL; + +ALTER TABLE brand_sponsor_item + ADD COLUMN sponsor_id BIGINT NULL; + +UPDATE brand_available_sponsor bas +JOIN brand_sponsor_info bsi ON bas.id = bsi.sponsor_id +SET bas.shipping_type = bsi.shipping_type; + +UPDATE brand_sponsor_item bsi_item +JOIN brand_sponsor_info bsi ON bsi_item.sponsor_info_id = bsi.id +SET bsi_item.sponsor_id = bsi.sponsor_id; + +ALTER TABLE brand_sponsor_item + DROP FOREIGN KEY FKet9dtmuqr2ba3moigtsxiabq2, + DROP COLUMN sponsor_info_id, + MODIFY sponsor_id BIGINT NOT NULL, + ADD CONSTRAINT fk_brand_sponsor_item_sponsor + FOREIGN KEY (sponsor_id) REFERENCES brand_available_sponsor(id); + +DROP TABLE brand_sponsor_info; diff --git a/src/main/java/com/example/RealMatch/brand/application/service/BrandService.java b/src/main/java/com/example/RealMatch/brand/application/service/BrandService.java index 57db0e05..c1c8bc96 100644 --- a/src/main/java/com/example/RealMatch/brand/application/service/BrandService.java +++ b/src/main/java/com/example/RealMatch/brand/application/service/BrandService.java @@ -18,6 +18,7 @@ import com.example.RealMatch.brand.domain.entity.BrandDescribeTag; import com.example.RealMatch.brand.domain.entity.BrandImage; import com.example.RealMatch.brand.domain.entity.BrandLike; +import com.example.RealMatch.brand.domain.entity.BrandSponsorImage; import com.example.RealMatch.brand.domain.entity.enums.IndustryType; import com.example.RealMatch.brand.domain.repository.BrandAvailableSponsorRepository; import com.example.RealMatch.brand.domain.repository.BrandCategoryRepository; @@ -31,7 +32,6 @@ import com.example.RealMatch.brand.presentation.dto.request.BrandBeautyUpdateRequestDto; import com.example.RealMatch.brand.presentation.dto.request.BrandFashionCreateRequestDto; import com.example.RealMatch.brand.presentation.dto.request.BrandFashionUpdateRequestDto; -import com.example.RealMatch.brand.presentation.dto.response.ActionDto; import com.example.RealMatch.brand.presentation.dto.response.BeautyFilterDto; import com.example.RealMatch.brand.presentation.dto.response.BrandCreateResponseDto; import com.example.RealMatch.brand.presentation.dto.response.BrandDetailResponseDto; @@ -56,12 +56,9 @@ import com.example.RealMatch.user.domain.repository.UserRepository; import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - @Service @RequiredArgsConstructor @Transactional(readOnly = true) -@Slf4j public class BrandService { private final BrandRepository brandRepository; @@ -78,7 +75,6 @@ public class BrandService { private final TagRepository tagRepository; private final UserRepository userRepository; - private static final Pattern URL_PATTERN = Pattern.compile("^https?://([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?$"); // ******** // @@ -222,54 +218,100 @@ public SponsorProductDetailResponseDto getSponsorProductDetail(Long brandId, Lon throw new IllegalArgumentException("해당 브랜드의 제품이 아닙니다."); } - List mockImageUrls = List.of( - "https://cdn.example.com/products/100/1.png", - "https://cdn.example.com/products/100/2.png", - "https://cdn.example.com/products/100/3.png" - ); + return buildSponsorProductDetailResponse(brand, product); + } - List mockCategories = List.of("스킨케어", "메이크업"); + @Transactional(readOnly = true) + public List getSponsorProducts(Long brandId) { + Brand brand = brandRepository.findById(brandId) + .orElseThrow(() -> new ResourceNotFoundException("브랜드 정보를 찾을 수 없습니다.")); - List mockItems = List.of( - SponsorItemDto.builder().itemId(1L).availableType("SAMPLE").availableQuantity(1).availableSize(50).sizeUnit("ml").build(), - SponsorItemDto.builder().itemId(2L).availableType("FULL").availableQuantity(1).availableSize(100).sizeUnit("ml").build() - ); + List products = brandAvailableSponsorRepository.findByBrandIdWithImages(brandId); + List categories = buildCategories(brand); - SponsorInfoDto sponsorInfo = SponsorInfoDto.builder() - .items(mockItems) - .shippingType("CREATOR_PAY") - .build(); + return products.stream() + .map(product -> buildSponsorProductListResponse(brand, product, categories)) + .collect(Collectors.toList()); + } - ActionDto action = ActionDto.builder() - .canProposeCampaign(true) - .proposeCampaignCtaText("캠페인 제안하기") - .build(); + private SponsorProductDetailResponseDto buildSponsorProductDetailResponse( + Brand brand, + BrandAvailableSponsor product + ) { + List imageUrls = buildProductImageUrls(product); + List categories = buildCategories(brand); + SponsorInfoDto sponsorInfoDto = buildSponsorInfo(brand, product); return SponsorProductDetailResponseDto.builder() .brandId(brand.getId()) .brandName(brand.getBrandName()) .productId(product.getId()) .productName(product.getName()) - .productDescription(product.getCampaign().getDescription()) - .productImageUrls(mockImageUrls) - .categories(mockCategories) - .sponsorInfo(sponsorInfo) - .action(action) + .productImageUrls(imageUrls) + .categories(categories) + .sponsorInfo(sponsorInfoDto) .build(); } - @Transactional(readOnly = true) - public List getSponsorProducts(Long brandId) { - brandRepository.findById(brandId) - .orElseThrow(() -> new ResourceNotFoundException("브랜드 정보를 찾을 수 없습니다.")); + private SponsorProductListResponseDto buildSponsorProductListResponse( + Brand brand, + BrandAvailableSponsor product, + List categories + ) { + List imageUrls = buildProductImageUrls(product); + SponsorInfoDto sponsorInfoDto = buildSponsorInfo(brand, product); - List products = brandAvailableSponsorRepository.findByBrandIdWithImages(brandId); + return SponsorProductListResponseDto.from(brand, product, imageUrls, categories, sponsorInfoDto); + } - return products.stream() - .map(SponsorProductListResponseDto::from) + private List buildProductImageUrls(BrandAvailableSponsor product) { + List images = product.getImages(); + if (images == null || images.isEmpty()) { + return List.of(); + } + return images.stream() + .map(BrandSponsorImage::getImageUrl) .collect(Collectors.toList()); } + private List buildCategories(Brand brand) { + if (brand.getIndustryType() == null) { + return List.of(); + } + if (brand.getIndustryType() == IndustryType.BEAUTY) { + return tagBrandRepository.findTagNamesByBrandIdAndTagCategory( + brand.getId(), TagCategory.BEAUTY_INTEREST_STYLE.getDescription()); + } + if (brand.getIndustryType() == IndustryType.FASHION) { + return tagBrandRepository.findTagNamesByBrandIdAndTagCategory( + brand.getId(), TagCategory.FASHION_INTEREST_ITEM.getDescription()); + } + return List.of(); + } + + private SponsorInfoDto buildSponsorInfo(Brand brand, BrandAvailableSponsor sponsor) { + if (sponsor.getItems().isEmpty()) { + return null; + } + List items = sponsor.getItems().stream() + .map(item -> { + SponsorItemDto.SponsorItemDtoBuilder builder = SponsorItemDto.builder() + .availableQuantity(item.getAvailableQuantity()); + if (brand.getIndustryType() == IndustryType.BEAUTY) { + builder.itemId(item.getId()) + .availableType(item.getAvailableType()) + .availableSize(item.getAvailableSize()) + .shippingType(item.getShippingType()); + } + return builder.build(); + }) + .collect(Collectors.toList()); + + return SponsorInfoDto.builder() + .items(items) + .build(); + } + // ******** // // 브랜드 생성 // // ******** // diff --git a/src/main/java/com/example/RealMatch/brand/domain/entity/BrandAvailableSponsor.java b/src/main/java/com/example/RealMatch/brand/domain/entity/BrandAvailableSponsor.java index 29272ca5..5a7ef58e 100644 --- a/src/main/java/com/example/RealMatch/brand/domain/entity/BrandAvailableSponsor.java +++ b/src/main/java/com/example/RealMatch/brand/domain/entity/BrandAvailableSponsor.java @@ -3,7 +3,6 @@ import java.util.ArrayList; import java.util.List; -import com.example.RealMatch.campaign.domain.entity.Campaign; import com.example.RealMatch.global.common.DeleteBaseEntity; import jakarta.persistence.CascadeType; @@ -32,10 +31,6 @@ public class BrandAvailableSponsor extends DeleteBaseEntity { @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "campaign_id", nullable = false) - private Campaign campaign; - @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "brand_id", nullable = false) private Brand brand; @@ -46,25 +41,20 @@ public class BrandAvailableSponsor extends DeleteBaseEntity { @Column(length = 1000) private String content; - // 1. 총 모집 인원 필드 추가 - @Column(name = "total_count", nullable = false) - private Integer totalCount; - - // 2. 현재 모집된 인원 필드 추가 (기본값 0) - @Column(name = "current_count", nullable = false) - private Integer currentCount = 0; + @OneToMany(mappedBy = "sponsor", fetch = FetchType.LAZY, cascade = CascadeType.ALL) + private List items = new ArrayList<>(); - // 3. 이미지 리스트 (1:N 관계) 필드 추가 - // mappedBy는 BrandSponsorImage 엔티티에 있는 변수명과 일치해야 합니다. @OneToMany(mappedBy = "sponsor", fetch = FetchType.LAZY, cascade = CascadeType.ALL) private List images = new ArrayList<>(); @Builder - public BrandAvailableSponsor(Campaign campaign, Brand brand, String name, String content, Integer totalCount) { - this.campaign = campaign; + public BrandAvailableSponsor( + Brand brand, + String name, + String content + ) { this.brand = brand; this.name = name; this.content = content; - this.totalCount = totalCount; } } diff --git a/src/main/java/com/example/RealMatch/brand/domain/entity/BrandSponsorItem.java b/src/main/java/com/example/RealMatch/brand/domain/entity/BrandSponsorItem.java new file mode 100644 index 00000000..4e6b12e5 --- /dev/null +++ b/src/main/java/com/example/RealMatch/brand/domain/entity/BrandSponsorItem.java @@ -0,0 +1,59 @@ +package com.example.RealMatch.brand.domain.entity; + +import com.example.RealMatch.global.common.DeleteBaseEntity; + +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import lombok.AccessLevel; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; + +@Entity +@Table(name = "brand_sponsor_item") +@Getter +@NoArgsConstructor(access = AccessLevel.PROTECTED) +public class BrandSponsorItem extends DeleteBaseEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne(fetch = FetchType.LAZY) + @JoinColumn(name = "sponsor_id", nullable = false) + private BrandAvailableSponsor sponsor; + + @Column(name = "available_type", length = 30) + private String availableType; + + @Column(name = "available_quantity") + private Integer availableQuantity; + + @Column(name = "available_size") + private Integer availableSize; + + @Column(name = "shipping_type", length = 30) + private String shippingType; + + @Builder + public BrandSponsorItem( + BrandAvailableSponsor sponsor, + String availableType, + Integer availableQuantity, + Integer availableSize, + String shippingType + ) { + this.sponsor = sponsor; + this.availableType = availableType; + this.availableQuantity = availableQuantity; + this.availableSize = availableSize; + this.shippingType = shippingType; + } +} diff --git a/src/main/java/com/example/RealMatch/brand/domain/repository/BrandAvailableSponsorRepository.java b/src/main/java/com/example/RealMatch/brand/domain/repository/BrandAvailableSponsorRepository.java index 9321057c..b242ea00 100644 --- a/src/main/java/com/example/RealMatch/brand/domain/repository/BrandAvailableSponsorRepository.java +++ b/src/main/java/com/example/RealMatch/brand/domain/repository/BrandAvailableSponsorRepository.java @@ -14,9 +14,4 @@ public interface BrandAvailableSponsorRepository extends JpaRepository findByBrandIdWithImages(@Param("brandId") Long brandId); - - List findByCampaignId(Long campaignId); - - @Query("SELECT s FROM BrandAvailableSponsor s LEFT JOIN FETCH s.images WHERE s.campaign.id = :campaignId") - List findByCampaignIdWithImages(@Param("campaignId") Long campaignId); } diff --git a/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorInfoDto.java b/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorInfoDto.java index fe10c6a5..4fa2e8c9 100644 --- a/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorInfoDto.java +++ b/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorInfoDto.java @@ -13,5 +13,4 @@ @AllArgsConstructor public class SponsorInfoDto { private List items; - private String shippingType; } diff --git a/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorItemDto.java b/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorItemDto.java index 2a321750..08dc4288 100644 --- a/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorItemDto.java +++ b/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorItemDto.java @@ -14,5 +14,5 @@ public class SponsorItemDto { private String availableType; private Integer availableQuantity; private Integer availableSize; - private String sizeUnit; + private String shippingType; } diff --git a/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorProductDetailResponseDto.java b/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorProductDetailResponseDto.java index 9ed24a0c..59817351 100644 --- a/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorProductDetailResponseDto.java +++ b/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorProductDetailResponseDto.java @@ -16,9 +16,7 @@ public class SponsorProductDetailResponseDto { private String brandName; private Long productId; private String productName; - private String productDescription; private List productImageUrls; private List categories; private SponsorInfoDto sponsorInfo; - private ActionDto action; } diff --git a/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorProductListResponseDto.java b/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorProductListResponseDto.java index 6d014b21..12b1ef0c 100644 --- a/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorProductListResponseDto.java +++ b/src/main/java/com/example/RealMatch/brand/presentation/dto/response/SponsorProductListResponseDto.java @@ -2,8 +2,8 @@ import java.util.List; +import com.example.RealMatch.brand.domain.entity.Brand; import com.example.RealMatch.brand.domain.entity.BrandAvailableSponsor; -import com.example.RealMatch.brand.domain.entity.BrandSponsorImage; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Builder; @@ -11,38 +11,54 @@ @Getter @Builder -@Schema(description = "협찬 가능 제품 리스트 응답 DTO") +@Schema(description = "협찬 가능 제품 리스트(상세 포함) 응답 DTO") public class SponsorProductListResponseDto { - @Schema(description = "협찬 제품 ID") - private Long id; + @Schema(description = "제품 대표 이미지 URL") + private String thumbnailImageUrl; + + @Schema(description = "브랜드 ID") + private Long brandId; + + @Schema(description = "브랜드명") + private String brandName; + + @Schema(description = "제품 ID") + private Long productId; @Schema(description = "제품명") - private String name; + private String productName; - @Schema(description = "제품 대표 이미지 URL") - private String thumbnailImageUrl; + @Schema(description = "제품 이미지 URL 목록") + private List productImageUrls; - @Schema(description = "총 모집 인원 (또는 제공 가능 수량)") - private Integer totalCount; + @Schema(description = "카테고리 목록") + private List categories; - @Schema(description = "현재 신청 인원 (또는 소진 수량)") - private Integer currentCount; + @Schema(description = "협찬 정보") + private SponsorInfoDto sponsorInfo; - public static SponsorProductListResponseDto from(BrandAvailableSponsor sponsor) { - // 이미지가 있다면 첫 번째 이미지를 썸네일로 사용 + public static SponsorProductListResponseDto from( + Brand brand, + BrandAvailableSponsor product, + List productImageUrls, + List categories, + SponsorInfoDto sponsorInfo + ) { String thumbnail = null; - List images = sponsor.getImages(); - if (images != null && !images.isEmpty()) { - thumbnail = images.get(0).getImageUrl(); + if (productImageUrls != null && !productImageUrls.isEmpty()) { + thumbnail = productImageUrls.get(0); } return SponsorProductListResponseDto.builder() - .id(sponsor.getId()) - .name(sponsor.getName()) .thumbnailImageUrl(thumbnail) - .totalCount(sponsor.getTotalCount()) // 엔티티 필드명에 맞춰 조정 필요 (예: quantity, capacity 등) - .currentCount(sponsor.getCurrentCount()) // 엔티티 필드명에 맞춰 조정 필요 + .brandId(brand.getId()) + .brandName(brand.getBrandName()) + .productId(product.getId()) + .productName(product.getName()) + .productImageUrls(productImageUrls) + .categories(categories) + .sponsorInfo(sponsorInfo) .build(); } } diff --git a/src/main/java/com/example/RealMatch/brand/presentation/swagger/BrandSwagger.java b/src/main/java/com/example/RealMatch/brand/presentation/swagger/BrandSwagger.java index 4d717b91..17fec11c 100644 --- a/src/main/java/com/example/RealMatch/brand/presentation/swagger/BrandSwagger.java +++ b/src/main/java/com/example/RealMatch/brand/presentation/swagger/BrandSwagger.java @@ -143,7 +143,7 @@ CustomResponse getSponsorProductDetail( @Parameter(description = "제품 ID", required = true) @PathVariable Long productId ); - @Operation(summary = "브랜드 협찬 가능 제품 리스트 조회 by 이예림", description = "특정 브랜드의 협찬 가능 제품 목록을 조회합니다.") + @Operation(summary = "브랜드 협찬 가능 제품 리스트 조회 by 이예림", description = "특정 브랜드의 협찬 가능 제품 목록을 상세 정보까지 조회합니다.") CustomResponse> getSponsorProducts( @Parameter(description = "브랜드 ID", required = true) @PathVariable Long brandId ); diff --git a/src/main/java/com/example/RealMatch/chat/application/service/room/CampaignSummaryServiceImpl.java b/src/main/java/com/example/RealMatch/chat/application/service/room/CampaignSummaryServiceImpl.java index 62334aa0..9e00f1e0 100644 --- a/src/main/java/com/example/RealMatch/chat/application/service/room/CampaignSummaryServiceImpl.java +++ b/src/main/java/com/example/RealMatch/chat/application/service/room/CampaignSummaryServiceImpl.java @@ -77,9 +77,10 @@ public CampaignSummaryResponse getCampaignSummary(Long roomId) { return null; } - // 캠페인 협찬 제품 조회 (요약 바용) + // 브랜드 협찬 제품 조회 (요약 바용) + Long brandId = campaign.getBrand().getId(); List sponsorProducts = brandAvailableSponsorRepository - .findByCampaignIdWithImages(campaignId) + .findByBrandIdWithImages(brandId) .stream() .map(CampaignSummaryServiceImpl::toSummarySponsorProduct) .collect(Collectors.toList()); diff --git a/src/test/java/com/example/RealMatch/RealMatchApplicationTests.java b/src/test/java/com/example/RealMatch/RealMatchApplicationTests.java index 1228974e..0a87dbc1 100644 --- a/src/test/java/com/example/RealMatch/RealMatchApplicationTests.java +++ b/src/test/java/com/example/RealMatch/RealMatchApplicationTests.java @@ -1,13 +1,13 @@ -package com.example.RealMatch; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class RealMatchApplicationTests { - - @Test - void contextLoads() { - } - -} +//package com.example.RealMatch; +// +//import org.junit.jupiter.api.Test; +//import org.springframework.boot.test.context.SpringBootTest; +// +//@SpringBootTest +//class RealMatchApplicationTests { +// +// @Test +// void contextLoads() { +// } +// +//} diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index 24ca0ed1..b625ce68 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -4,6 +4,11 @@ cors: swagger: server-url: http://localhost:8080 +front: + domain-url: http://localhost:3000 + domain-url-v2: http://localhost:3000 + domain-url-local: http://localhost:3000 + server: timezone: Asia/Seoul @@ -12,10 +17,10 @@ spring: name: Realmatch datasource: - url: jdbc:mysql://localhost:3306/test_db - username: test_user - password: test - driver-class-name: com.mysql.cj.jdbc.Driver + url: ${TEST_DATASOURCE_URL:jdbc:h2:mem:test_db;MODE=MySQL;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE} + username: ${TEST_DATASOURCE_USERNAME:sa} + password: ${TEST_DATASOURCE_PASSWORD:} + driver-class-name: ${TEST_DATASOURCE_DRIVER:org.h2.Driver} hikari: maximum-pool-size: 10 minimum-idle: 5 @@ -28,7 +33,7 @@ spring: ddl-auto: create-drop properties: hibernate: - dialect: ${JPA_HIBERNATE_DIALECT} + dialect: ${JPA_HIBERNATE_DIALECT:org.hibernate.dialect.H2Dialect} format_sql: true show-sql: false