Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy | CAKK-56 | v2.0.4 배포 #195

Merged
merged 55 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
783b2e6
Fix | CAKK-25 | Test method 접근제한자 수정
YongsHub Aug 13, 2024
339ea52
Test | CAKK-25 | 케이크 샵 주인 인증 완료 시, 정책 도메인으로 캡슐화 및 테스트
YongsHub Aug 13, 2024
390df7c
Feature | CAKK-25 | 인증 상태 여부 필드를 위한 Converter 추가
YongsHub Aug 13, 2024
551d0ef
Fix | CAKK-25 | 메서드 네이밍 변경
YongsHub Aug 13, 2024
63c3262
Test | CAKK-25 | 인증 정책 테스트 추가
YongsHub Aug 13, 2024
a3da8d8
Refactor | CAKK-25 | 사업자 정보 케이크샵 주인 업데이트 로직 리팩토링
YongsHub Aug 13, 2024
d10b240
Feature | CAKK-25 | 케이크샵 주인 후보 여부 조회 로직 추가 및 테스트
YongsHub Aug 13, 2024
98fd075
Fix | CAKK-25 | 케이크샵 생성자 롬복 제거
YongsHub Aug 13, 2024
ee81b04
Fix | CAKK-25 | 어드민 API 분리
YongsHub Aug 13, 2024
a8ae1cb
Feature | CAKK-25 | 사장님 인증 요청 리스트 목록 어플리케이션 로직 추가
YongsHub Aug 13, 2024
17b8baf
Test | CAKK-25| 사장님 인증 요청 목록 통합 테스트 추가
YongsHub Aug 13, 2024
4407ae9
Refactor | CAKK-25 | checkstyle 반영
YongsHub Aug 13, 2024
c6f6206
Test | CAKK-25 | 빠졌던 테스트 추가 및 build 문제 해결
YongsHub Aug 13, 2024
f329b29
Fix | CAKK-25 | 인증 정책 응집도를 위한 패키지 수정
YongsHub Aug 13, 2024
b740880
Fix | CAKK-25 | 요청 데이터에 따른 response 수정
YongsHub Aug 13, 2024
964166a
Fix | CAKK-25 | 코드 리뷰 반영
YongsHub Aug 14, 2024
d618169
Feature: 케이크샵 인증 요청 리스트 API 개발
YongsHub Aug 14, 2024
76b4580
Fix | CAKK-26 | dto 네이밍 수정
YongsHub Aug 14, 2024
e5c4b2b
Feature | CAKK-26 | 인증 요청 상세 내용 조회 애플리케이션 로직 추가
YongsHub Aug 14, 2024
51d40eb
Feature | CAKK-26 | 상세조회를 위한 쿼리 추가
YongsHub Aug 14, 2024
b5e3c6b
Test | CAKK-26 | 인증 요청 상세 내용 통합 테스트 추가
YongsHub Aug 14, 2024
0f4b500
Refactor | CAKK-26 | checkstyle 반영
YongsHub Aug 14, 2024
ac13af6
Fix | CAKK-26 | response data builder 사용으로 수정
YongsHub Aug 14, 2024
f893d05
Feature: 사장님 인증 요청 상세 내용 조회 API 개발
YongsHub Aug 14, 2024
167c889
Chore | CAKK-35 | kotlin 2.0 설정
lcomment Aug 15, 2024
05b196a
Chore | CAKK-35 | admin 모듈 설정
lcomment Aug 15, 2024
8bcaa01
Chore | CAKK-35 | admin 모듈 설정
lcomment Aug 15, 2024
a3d47b3
Refactor | CAKK-35 | admin 관련 일부 비즈니스 이관
lcomment Aug 15, 2024
3626d1b
Chore: kotlin 설정 및 admin 모듈 이관 작업
lcomment Aug 15, 2024
53d15e2
Fix | CAKK-36 | CakeShop Domain에서 인증 연결 여부 상태 제거
YongsHub Aug 15, 2024
6f167d4
Refactor | CAKK-36 | 케이크샵 사장님 인증 요청 로직 리팩토링
YongsHub Aug 15, 2024
b583550
Test | CAKK-36 | 케이크샵 사장님 인증 요청 테스트 리팩토링
YongsHub Aug 15, 2024
10e2003
Refactor | CAKK-36 | 불필요한 메서드 제거
YongsHub Aug 15, 2024
641bedf
Refactor | CAKK-36 | User Role에서 Business Owner제거로 인한 리팩토링
YongsHub Aug 16, 2024
df9710c
Fix | CAKK-36 | 인증 요청 시, cakeShop nullable 제거 및 테스트 제거
YongsHub Aug 16, 2024
64f1c76
Refactor | CAKK-36 | 인증 요청과 검증 로직 분리 리팩토링
YongsHub Aug 16, 2024
c242fd8
Chore | CAKK-40 | 모듈 간 설정 수정
lcomment Aug 16, 2024
e2a38da
Chore | CAKK-40 | 어드민 모듈 의존성 추가
lcomment Aug 16, 2024
ca3409c
Test | CAKK-36 | 로직 리팩토링으로 인한 테스트 리팩토링
YongsHub Aug 16, 2024
5247de5
Fix | CAKK-36 | 인증 여부 필드로 인한 쿼리 수정
YongsHub Aug 16, 2024
21134a4
Refactor | CAKK-36 | checkstyle 적용
YongsHub Aug 16, 2024
353c605
Fix | CAKK-36 | sql file 테이블 구조 변경으로 수정
YongsHub Aug 16, 2024
5e74048
Refactor | CAKK-40 | BusinessInformation 관련 기능 이관
lcomment Aug 18, 2024
60e1654
Refactor | CAKK-36 | 코드 리뷰 반영 및 사장님 인증 승인에서의 검증 로직 추가
YongsHub Aug 18, 2024
8e9a05c
Test | CAKK-36 | 사장님으로 승인 시, 검증으로 인한 테스트 코드 수정
YongsHub Aug 18, 2024
ff9645b
Refactor: 케이크 샵 인증 요청 로직 개선
YongsHub Aug 18, 2024
53bb339
Refactor | CAKK-42 | Cake 관련 기능 이관
lcomment Aug 22, 2024
a867773
Refactor | CAKK-41 | 케이크 샵 관련 기능 이관
lcomment Aug 23, 2024
7cb28c9
Merge branch 'master' into develop
lcomment Aug 23, 2024
6dc02ff
Refactor | CAKK-54 | 케이크 하트 기능 리팩토링
lcomment Aug 26, 2024
7c1ff31
Refactor | CAKK-55 | 케이크샵 하트 및 기대돼요 기능 리팩토링
lcomment Aug 28, 2024
ea6d0fc
Merge branch 'master' into develop
lcomment Aug 28, 2024
11d0a26
Fix | CAKK-56 | git 충돌 해결
lcomment Aug 28, 2024
06de189
Fix | CAKK-56 | git 충돌 해결
lcomment Aug 28, 2024
1160b89
Refactor | CAKK-56 | checkstyle 반영
lcomment Aug 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ jobs:
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: ./cakk-api/build/test-results/**/*.xml
files: |
./cakk-api/build/test-results/**/*.xml
./cakk-domain/mysql/build/test-results/**/*.xml

- name: Upload test coverage
id: jacoco
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ public ApiResponse<Void> like(
@SignInUser User user,
@PathVariable Long cakeShopId
) {
likeService.validateLikeCount(user, cakeShopId);
likeService.likeCakeShop(user, cakeShopId);

return ApiResponse.success();
Expand Down
28 changes: 10 additions & 18 deletions cakk-api/src/main/java/com/cakk/api/service/like/HeartService.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,16 @@
import com.cakk.api.mapper.CakeMapper;
import com.cakk.api.mapper.HeartMapper;
import com.cakk.api.mapper.ShopMapper;
import com.cakk.common.enums.RedisKey;
import com.cakk.domain.mysql.dto.param.like.HeartCakeImageResponseParam;
import com.cakk.domain.mysql.dto.param.like.HeartCakeShopResponseParam;
import com.cakk.domain.mysql.entity.cake.Cake;
import com.cakk.domain.mysql.entity.cake.CakeHeart;
import com.cakk.domain.mysql.entity.shop.CakeShop;
import com.cakk.domain.mysql.entity.shop.CakeShopHeart;
import com.cakk.domain.mysql.entity.user.User;
import com.cakk.domain.mysql.facade.user.UserHeartFacade;
import com.cakk.domain.mysql.repository.reader.CakeHeartReader;
import com.cakk.domain.mysql.repository.reader.CakeReader;
import com.cakk.domain.mysql.repository.reader.CakeShopHeartReader;
import com.cakk.domain.mysql.repository.reader.CakeShopReader;
import com.cakk.domain.mysql.repository.writer.CakeHeartWriter;
import com.cakk.domain.mysql.repository.writer.CakeShopHeartWriter;
import com.cakk.domain.redis.repository.LockRedisRepository;

@RequiredArgsConstructor
@Service
Expand All @@ -39,9 +34,8 @@ public class HeartService {
private final CakeReader cakeReader;
private final CakeShopReader cakeShopReader;
private final CakeHeartReader cakeHeartReader;
private final CakeHeartWriter cakeHeartWriter;
private final CakeShopHeartReader cakeShopHeartReader;
private final CakeShopHeartWriter cakeShopHeartWriter;
private final UserHeartFacade userHeartFacade;

@Transactional(readOnly = true)
public HeartCakeImageListResponse searchCakeImagesByCursorAndHeart(
Expand Down Expand Up @@ -73,33 +67,31 @@ public HeartCakeShopListResponse searchCakeShopByCursorAndHeart(

@Transactional(readOnly = true)
public HeartResponse isHeartCake(final User user, final Long cakeId) {
final Cake cake = cakeReader.findById(cakeId);
final boolean isHeart = cakeHeartReader.existsByUserAndCake(user, cake);
final Cake cake = cakeReader.findByIdWithHeart(cakeId);
final boolean isHeart = cake.isHeartedBy(user);

return HeartMapper.supplyHeartResponseBy(isHeart);
}

@Transactional(readOnly = true)
public HeartResponse isHeartCakeShop(final User user, final Long cakeShopId) {
final CakeShop cakeShop = cakeShopReader.findById(cakeShopId);
final boolean isHeart = cakeShopHeartReader.existsByUserAndCakeShop(user, cakeShop);
final CakeShop cakeShop = cakeShopReader.findByIdWithHeart(cakeShopId);
final boolean isHeart = cakeShop.isHeartedBy(user);

return HeartMapper.supplyHeartResponseBy(isHeart);
}

@DistributedLock(key = "#cakeId")
public void heartCake(final User user, final Long cakeId) {
final Cake cake = cakeReader.findById(cakeId);
final CakeHeart cakeHeart = cakeHeartReader.findOrNullByUserAndCake(user, cake);
final Cake cake = cakeReader.findByIdWithHeart(cakeId);

cakeHeartWriter.heartOrCancel(cakeHeart, user, cake);
userHeartFacade.heartCake(user, cake);
}

@DistributedLock(key = "#cakeShopId")
public void heartCakeShop(final User user, final Long cakeShopId) {
final CakeShop cakeShop = cakeShopReader.findById(cakeShopId);
final CakeShopHeart cakeShopHeart = cakeShopHeartReader.findOrNullByUserAndCakeShop(user, cakeShop);
final CakeShop cakeShop = cakeShopReader.findByIdWithHeart(cakeShopId);

cakeShopHeartWriter.heartOrCancel(cakeShopHeart, user, cakeShop);
userHeartFacade.heartCakeShop(user, cakeShop);
}
}
22 changes: 4 additions & 18 deletions cakk-api/src/main/java/com/cakk/api/service/like/LikeService.java
Original file line number Diff line number Diff line change
@@ -1,40 +1,26 @@
package com.cakk.api.service.like;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import lombok.RequiredArgsConstructor;

import com.cakk.api.annotation.DistributedLock;
import com.cakk.common.enums.ReturnCode;
import com.cakk.common.exception.CakkException;
import com.cakk.domain.mysql.entity.shop.CakeShop;
import com.cakk.domain.mysql.entity.user.User;
import com.cakk.domain.mysql.repository.reader.CakeShopLikeReader;
import com.cakk.domain.mysql.facade.user.UserLikeFacade;
import com.cakk.domain.mysql.repository.reader.CakeShopReader;
import com.cakk.domain.mysql.repository.writer.CakeShopLikeWriter;

@Service
@RequiredArgsConstructor
public class LikeService {

private final CakeShopReader cakeShopReader;
private final CakeShopLikeReader cakeShopLikeReader;
private final CakeShopLikeWriter cakeShopLikeWriter;

@Transactional(readOnly = true)
public void validateLikeCount(final User user, final Long cakeShopId) {
final int likeCount = cakeShopLikeReader.countByCakeShopIdAndUser(cakeShopId, user);

if (likeCount >= 50) {
throw new CakkException(ReturnCode.MAX_CAKE_SHOP_LIKE);
}
}
private final UserLikeFacade userCakeFacade;

@DistributedLock(key = "#cakeShopId")
public void likeCakeShop(final User user, final Long cakeShopId) {
final CakeShop cakeShop = cakeShopReader.findById(cakeShopId);
final CakeShop cakeShop = cakeShopReader.findByIdWithLike(cakeShopId);

cakeShopLikeWriter.like(cakeShop, user);
userCakeFacade.likeCakeShop(user, cakeShop);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,15 @@
import com.cakk.domain.mysql.dto.param.like.HeartCakeImageResponseParam;
import com.cakk.domain.mysql.entity.cake.Cake;
import com.cakk.domain.mysql.entity.shop.CakeShop;
import com.cakk.domain.mysql.entity.shop.CakeShopHeart;
import com.cakk.domain.mysql.entity.user.User;
import com.cakk.domain.mysql.facade.user.UserHeartFacade;
import com.cakk.domain.mysql.repository.reader.CakeHeartReader;
import com.cakk.domain.mysql.repository.reader.CakeReader;
import com.cakk.domain.mysql.repository.reader.CakeShopHeartReader;
import com.cakk.domain.mysql.repository.reader.CakeShopReader;
import com.cakk.domain.mysql.repository.writer.CakeHeartWriter;
import com.cakk.domain.mysql.repository.writer.CakeShopHeartWriter;

@DisplayName("하트 기능 관련 비즈니스 로직 테스트")
public class HeartServiceTest extends ServiceTest {
class HeartServiceTest extends ServiceTest {

@InjectMocks
private HeartService heartService;
Expand All @@ -45,14 +43,12 @@ public class HeartServiceTest extends ServiceTest {
@Mock
private CakeHeartReader cakeHeartReader;

@Mock
private CakeHeartWriter cakeHeartWriter;

@Mock
private CakeShopHeartReader cakeShopHeartReader;

@Mock
private CakeShopHeartWriter cakeShopHeartWriter;
private UserHeartFacade userHeartFacade;


@TestWithDisplayName("하트 한 케이크 목록을 조회한다.")
void findCakeImagesByCursorAndHeart() {
Expand Down Expand Up @@ -135,59 +131,53 @@ void heartCake1() {
final Long cakeId = 1L;
final Cake cake = getConstructorMonkey().giveMeOne(Cake.class);

doReturn(cake).when(cakeReader).findById(cakeId);
doReturn(null).when(cakeHeartReader).findOrNullByUserAndCake(user, cake);
doReturn(cake).when(cakeReader).findByIdWithHeart(cakeId);
doNothing().when(userHeartFacade).heartCake(user, cake);

// when & then
assertDoesNotThrow(() -> heartService.heartCake(user, cakeId));

verify(cakeReader, times(1)).findById(cakeId);
verify(cakeHeartReader, times(1)).findOrNullByUserAndCake(user, cake);
verify(cakeReader, times(1)).findByIdWithHeart(cakeId);
verify(userHeartFacade, times(1)).heartCake(user, cake);
}

@TestWithDisplayName("해당 케이크가 없으면 하트 동작을 실패한다.")
@TestWithDisplayName("케이크에 대하여 하트 취소를 동작한다.")
void heartCake2() {
// given
final User user = getUser();
final Long cakeId = 1L;
final Cake cake = getConstructorMonkey().giveMeOne(Cake.class);
cake.heart(user);

doThrow(new CakkException(ReturnCode.NOT_EXIST_CAKE)).when(cakeReader).findById(cakeId);
doReturn(cake).when(cakeReader).findByIdWithHeart(cakeId);
doNothing().when(userHeartFacade).heartCake(user, cake);

// when & then
assertThrows(
CakkException.class,
() -> heartService.heartCake(user, cakeId),
ReturnCode.NOT_EXIST_CAKE.getMessage());
assertDoesNotThrow(() -> heartService.heartCake(user, cakeId));

verify(cakeReader, times(1)).findById(cakeId);
verify(cakeHeartReader, times(0)).findOrNullByUserAndCake(user, cake);
verify(cakeReader, times(1)).findByIdWithHeart(cakeId);
verify(userHeartFacade, times(1)).heartCake(user, cake);
}

@TestWithDisplayName("케이크 샵에 대하여 하트를 동작한다.")
void heartCakeShop1() {
@TestWithDisplayName("해당 케이크가 없으면 하트 동작을 실패한다.")
void heartCake3() {
// given
final User user = getUser();
final Long cakeShopId = 1L;
final CakeShop cakeShop = getConstructorMonkey().giveMeBuilder(CakeShop.class)
.set("shopName", Arbitraries.strings().withCharRange('a', 'z').ofMaxLength(30))
.set("shopBio", Arbitraries.strings().withCharRange('a', 'z').ofMaxLength(40))
.set("shopDescription", Arbitraries.strings().withCharRange('a', 'z').ofMaxLength(500))
.set("location", supplyPointBy(Arbitraries.doubles().sample(), Arbitraries.doubles().sample()))
.sample();
final Long cakeId = 1L;

doReturn(cakeShop).when(cakeShopReader).findById(cakeShopId);
doReturn(null).when(cakeShopHeartReader).findOrNullByUserAndCakeShop(user, cakeShop);
doThrow(new CakkException(ReturnCode.NOT_EXIST_CAKE)).when(cakeReader).findByIdWithHeart(cakeId);

// when & then
assertDoesNotThrow(() -> heartService.heartCakeShop(user, cakeShopId));
assertThrows(
CakkException.class,
() -> heartService.heartCake(user, cakeId),
ReturnCode.NOT_EXIST_CAKE.getMessage());

verify(cakeShopReader, times(1)).findById(cakeShopId);
verify(cakeShopHeartReader, times(1)).findOrNullByUserAndCakeShop(user, cakeShop);
verify(cakeReader, times(1)).findByIdWithHeart(cakeId);
}

@TestWithDisplayName("케이크 샵에 대하여 하트 취소를 동작한다.")
void heartCakeShop2() {
@TestWithDisplayName("케이크 샵에 대하여 하트를 동작한다.")
void heartCakeShop1() {
// given
final User user = getUser();
final Long cakeShopId = 1L;
Expand All @@ -197,16 +187,15 @@ void heartCakeShop2() {
.set("shopDescription", Arbitraries.strings().withCharRange('a', 'z').ofMaxLength(500))
.set("location", supplyPointBy(Arbitraries.doubles().sample(), Arbitraries.doubles().sample()))
.sample();
final CakeShopHeart cakeShopHeart = getConstructorMonkey().giveMeOne(CakeShopHeart.class);

doReturn(cakeShop).when(cakeShopReader).findById(cakeShopId);
doReturn(cakeShopHeart).when(cakeShopHeartReader).findOrNullByUserAndCakeShop(user, cakeShop);
doReturn(cakeShop).when(cakeShopReader).findByIdWithHeart(cakeShopId);
doNothing().when(userHeartFacade).heartCakeShop(user, cakeShop);

// when & then
assertDoesNotThrow(() -> heartService.heartCakeShop(user, cakeShopId));

verify(cakeShopReader, times(1)).findById(cakeShopId);
verify(cakeShopHeartReader, times(1)).findOrNullByUserAndCakeShop(user, cakeShop);
verify(cakeShopReader, times(1)).findByIdWithHeart(cakeShopId);
verify(userHeartFacade, times(1)).heartCakeShop(user, cakeShop);
}

@TestWithDisplayName("해당 케이크 샵이 없으면 하트 동작을 실패한다.")
Expand All @@ -215,15 +204,15 @@ void heartCakeShop3() {
final User user = getUser();
final Long cakeShopId = 1L;

doThrow(new CakkException(ReturnCode.NOT_EXIST_CAKE_SHOP)).when(cakeShopReader).findById(cakeShopId);
doThrow(new CakkException(ReturnCode.NOT_EXIST_CAKE_SHOP)).when(cakeShopReader).findByIdWithHeart(cakeShopId);

// when & then
assertThrows(
CakkException.class,
() -> heartService.heartCakeShop(user, cakeShopId),
ReturnCode.NOT_EXIST_CAKE_SHOP.getMessage());

verify(cakeShopReader, times(1)).findById(cakeShopId);
verify(cakeShopReader, times(1)).findByIdWithHeart(cakeShopId);
verify(cakeShopHeartReader, times(0)).findOrNullByUserAndCakeShop(any(User.class), any(CakeShop.class));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@

import com.cakk.api.common.annotation.TestWithDisplayName;
import com.cakk.api.common.base.ServiceTest;
import com.cakk.common.enums.ReturnCode;
import com.cakk.common.exception.CakkException;
import com.cakk.domain.mysql.entity.shop.CakeShop;
import com.cakk.domain.mysql.entity.user.User;
import com.cakk.domain.mysql.repository.reader.CakeShopLikeReader;
import com.cakk.domain.mysql.facade.user.UserLikeFacade;
import com.cakk.domain.mysql.repository.reader.CakeShopReader;
import com.cakk.domain.mysql.repository.writer.CakeShopLikeWriter;

@DisplayName("좋아요 기능 관련 비즈니스 로직 테스트")
public class LikeServiceTest extends ServiceTest {

Expand All @@ -29,39 +25,7 @@ public class LikeServiceTest extends ServiceTest {
private CakeShopReader cakeShopReader;

@Mock
private CakeShopLikeReader cakeShopLikeReader;

@Mock
private CakeShopLikeWriter cakeShopLikeWriter;

@TestWithDisplayName("좋아요 개수 50개가 넘지 않으면 유효성 검사에 통과한다.")
void validateLikeCountSuccess() {
// given
final User user = getUser();
final long cakeShopId = Arbitraries.longs().greaterOrEqual(1).sample();
final int likeCount = Arbitraries.integers().lessOrEqual(49).sample();

doReturn(likeCount).when(cakeShopLikeReader).countByCakeShopIdAndUser(cakeShopId, user);

// when & then
assertDoesNotThrow(() -> likeService.validateLikeCount(user, cakeShopId));
}

@TestWithDisplayName("좋아요 개수 50개가 넘으면 유효성 검사에서 에러를 반환한다.")
void validateLikeCountFail() {
// given
final User user = getUser();
final long cakeShopId = Arbitraries.longs().greaterOrEqual(1).sample();
final int likeCount = Arbitraries.integers().greaterOrEqual(50).sample();

doReturn(likeCount).when(cakeShopLikeReader).countByCakeShopIdAndUser(cakeShopId, user);

// when & then
assertThrows(
CakkException.class,
() -> likeService.validateLikeCount(user, cakeShopId),
ReturnCode.MAX_CAKE_SHOP_LIKE.getMessage());
}
private UserLikeFacade userLikeFacade;

@TestWithDisplayName("케이크 샵 좋아요를 성공한다.")
void likeCakeShop() {
Expand All @@ -75,8 +39,8 @@ void likeCakeShop() {
.set("location", supplyPointBy(Arbitraries.doubles().sample(), Arbitraries.doubles().sample()))
.sample();

doReturn(cakeShop).when(cakeShopReader).findById(cakeShopId);
doNothing().when(cakeShopLikeWriter).like(cakeShop, user);
doReturn(cakeShop).when(cakeShopReader).findByIdWithLike(cakeShopId);
doNothing().when(userLikeFacade).likeCakeShop(user, cakeShop);

// when
likeService.likeCakeShop(user, cakeShopId);
Expand Down
2 changes: 1 addition & 1 deletion cakk-api/src/test/resources/sql/insert-cake-shop.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SET @g9 = 'Point(37.543343 127.052609)';
SET @g10 = 'Point(37.541530 127.054164)';

insert into cake_shop (shop_id, thumbnail_url, shop_name, shop_address, shop_bio, shop_description, location, like_count, heart_count, created_at, updated_at)
values (1, 'thumbnail_url1', '케이크 맛집1', '케이크 맛집입니다.', '서울시 강남구 어쩌고로1', '케이크 맛집입니다.', ST_GeomFromText(@g1, 4326), 0, 0, now(), now()),
values (1, 'thumbnail_url1', '케이크 맛집1', '케이크 맛집입니다.', '서울시 강남구 어쩌고로1', '케이크 맛집입니다.', ST_GeomFromText(@g1, 4326), 0, 1, now(), now()),
(2, 'thumbnail_url2', '케이크 맛집2', '케이크 맛집입니다.', '서울시 강남구 어쩌고로2', '케이크 맛집입니다.', ST_GeomFromText(@g2, 4326), 0, 0, now(), now()),
(3, 'thumbnail_url3', '케이크 맛집3', '케이크 맛집입니다.', '서울시 강남구 어쩌고로3', '케이크 맛집입니다.', ST_GeomFromText(@g3, 4326), 0, 0, now(), now()),
(4, 'thumbnail_url4', '케이크 맛집4', '케이크 맛집입니다.', '서울시 강남구 어쩌고로3', '케이크 맛집입니다.', ST_GeomFromText(@g4, 4326), 0, 0, now(), now()),
Expand Down
2 changes: 1 addition & 1 deletion cakk-api/src/test/resources/sql/insert-cake.sql
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ values (1, 1, 0, '10:00:00', '22:00:00', now(), now()),
insert into cake (cake_id, shop_id, cake_image_url, heart_count, created_at, updated_at)
values (1, 1, 'cake_image_url1', 0, now(), now()),
(2, 1, 'cake_image_url2', 0, now(), now()),
(3, 1, 'cake_image_url3', 0, now(), now()),
(3, 1, 'cake_image_url3', 1, now(), now()),
(4, 2, 'cake_image_url4', 0, now(), now()),
(5, 2, 'cake_image_url5', 0, now(), now()),
(6, 2, 'cake_image_url6', 0, now(), now()),
Expand Down
2 changes: 1 addition & 1 deletion cakk-domain/mysql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
implementation 'io.hypersistence:hypersistence-utils-hibernate-63:3.7.4'

// test
testImplementation("com.navercorp.fixturemonkey:fixture-monkey-starter:1.0.16")
testImplementation("com.navercorp.fixturemonkey:fixture-monkey-starter:1.0.23")
testImplementation('org.assertj:assertj-core')
testImplementation('org.junit.jupiter:junit-jupiter')
testRuntimeOnly('org.junit.platform:junit-platform-launcher')
Expand Down
Loading
Loading