From d4fcd248e16747d439c213340ecee317c7401103 Mon Sep 17 00:00:00 2001 From: FeelingXD Date: Mon, 19 Jun 2023 21:55:04 +0900 Subject: [PATCH 1/7] =?UTF-8?q?refactor:=20=EC=A4=91=EB=B3=B5=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=A0=9C=EA=B1=B0=20User=20tag.=EA=B0=80=20?= =?UTF-8?q?=EB=91=90=EB=B2=88=20=EC=A1=B0=EC=9D=B8=EB=90=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fab/banggabgo/repository/impl/UserRepositoryImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/fab/banggabgo/repository/impl/UserRepositoryImpl.java b/src/main/java/com/fab/banggabgo/repository/impl/UserRepositoryImpl.java index 8966d75..651dd64 100644 --- a/src/main/java/com/fab/banggabgo/repository/impl/UserRepositoryImpl.java +++ b/src/main/java/com/fab/banggabgo/repository/impl/UserRepositoryImpl.java @@ -22,7 +22,6 @@ public Optional findByEmail(String email) { var query = queryFactory.selectFrom(qUser) .leftJoin(qUser.roles).fetchJoin() .leftJoin(qUser.tag).fetchJoin() - .leftJoin(qUser.tag).fetchJoin() .where(qUser.email.eq(email)); return Optional.ofNullable(query.fetchOne()); } From d0d5593a687debb8608056cbbaeca391abc31cd7 Mon Sep 17 00:00:00 2001 From: FeelingXD Date: Mon, 19 Jun 2023 21:57:41 +0900 Subject: [PATCH 2/7] =?UTF-8?q?refactor:=20=EC=82=AC=EC=9A=A9=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EB=B3=80=EC=88=98=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 정책변경에서 누락된 prefereedAge 사용제거 --- .../com/fab/banggabgo/dto/mycontent/MyInfoDto.java | 1 - .../java/com/fab/banggabgo/type/PreferredAge.java | 12 ------------ 2 files changed, 13 deletions(-) delete mode 100644 src/main/java/com/fab/banggabgo/type/PreferredAge.java diff --git a/src/main/java/com/fab/banggabgo/dto/mycontent/MyInfoDto.java b/src/main/java/com/fab/banggabgo/dto/mycontent/MyInfoDto.java index 1e6e481..596beee 100644 --- a/src/main/java/com/fab/banggabgo/dto/mycontent/MyInfoDto.java +++ b/src/main/java/com/fab/banggabgo/dto/mycontent/MyInfoDto.java @@ -35,7 +35,6 @@ public class MyInfoDto { private Integer minAge; private Integer maxAge; - private String preferredAge; private Integer myAge; private String detail; diff --git a/src/main/java/com/fab/banggabgo/type/PreferredAge.java b/src/main/java/com/fab/banggabgo/type/PreferredAge.java deleted file mode 100644 index e141742..0000000 --- a/src/main/java/com/fab/banggabgo/type/PreferredAge.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.fab.banggabgo.type; - -public enum PreferredAge { - TEENAGER, - TWENTIES, - THIRTIES, - FORTIES, - FIFTIES, - SIXTIES, - SEVENTIES, - EIGHTIES -} From 9a32244b9b5065942d496117c1eeacaa9525b247 Mon Sep 17 00:00:00 2001 From: FeelingXD Date: Mon, 19 Jun 2023 21:57:59 +0900 Subject: [PATCH 3/7] =?UTF-8?q?refactor:=20=EC=82=AC=EC=9A=A9=EB=90=98?= =?UTF-8?q?=EC=A7=80=EC=95=8A=EB=8A=94=20=EB=A9=94=EC=84=9C=EB=93=9C=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/fab/banggabgo/service/MyContentService.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/fab/banggabgo/service/MyContentService.java b/src/main/java/com/fab/banggabgo/service/MyContentService.java index 79426ce..4535b35 100644 --- a/src/main/java/com/fab/banggabgo/service/MyContentService.java +++ b/src/main/java/com/fab/banggabgo/service/MyContentService.java @@ -5,7 +5,6 @@ import com.fab.banggabgo.dto.mycontent.FavoriteArticleDto; import com.fab.banggabgo.dto.mycontent.MyArticleDto; import com.fab.banggabgo.dto.mycontent.MyInfoDto; -import com.fab.banggabgo.dto.mycontent.PatchMyInfoDto; import com.fab.banggabgo.dto.mycontent.PatchMyInfoRequestDto; import com.fab.banggabgo.dto.mycontent.PatchMyInfoResultDto; import com.fab.banggabgo.dto.mycontent.PatchMyNicknameRequestDto; @@ -31,7 +30,6 @@ PostMyInfoImageResultDto postMyInfoImage(User user, PostMyInfoImageRequestDto dt throws IOException; PatchMyInfoResultDto patchMyInfo(User user, PatchMyInfoRequestDto form); - PatchMyInfoResultDto patchMyInfo(User user, PatchMyInfoDto form); List getMyFromApplicantList(User user, Integer page, Integer size); From 0246ad8818340f8875fdc702ad58da1c9d368933 Mon Sep 17 00:00:00 2001 From: FeelingXD Date: Mon, 19 Jun 2023 23:13:24 +0900 Subject: [PATCH 4/7] =?UTF-8?q?refactor:=20QueryDSL=20=EC=A1=B0=EA=B1=B4?= =?UTF-8?q?=20=EB=B0=8F=20=EB=A1=9C=EC=A7=81=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 추천유저 검색로직 개선 나이범위가 잘못 적용된 쿼리 개선 - Where 조건 BooleanExpression을 이용한 직관성 개선 - 하드코딩 된 변수를 주입해서 사용할수있도록 변경 --- .../impl/ArticleRepositoryImpl.java | 66 ++++++++++--------- .../repository/impl/UserRepositoryImpl.java | 52 ++++++++++++--- src/main/resources/application.yml | 5 +- 3 files changed, 83 insertions(+), 40 deletions(-) diff --git a/src/main/java/com/fab/banggabgo/repository/impl/ArticleRepositoryImpl.java b/src/main/java/com/fab/banggabgo/repository/impl/ArticleRepositoryImpl.java index c426e9c..4f2e975 100644 --- a/src/main/java/com/fab/banggabgo/repository/impl/ArticleRepositoryImpl.java +++ b/src/main/java/com/fab/banggabgo/repository/impl/ArticleRepositoryImpl.java @@ -12,18 +12,24 @@ import com.fab.banggabgo.type.Gender; import com.fab.banggabgo.type.Period; import com.fab.banggabgo.type.Seoul; +import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.jpa.impl.JPAQueryFactory; import java.util.List; import java.util.stream.Collectors; import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Page; import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.Pageable; +import org.springframework.util.StringUtils; @RequiredArgsConstructor public class ArticleRepositoryImpl implements ArticleRepositoryCustom { private final JPAQueryFactory queryFactory; + + @Value("${query.default.static}") + private String default_option; QArticle qArticle = QArticle.article; QUser qUser = QUser.user; QLikeArticle qLikeArticle= QLikeArticle.likeArticle; @@ -34,15 +40,11 @@ public Page
getArticle(Pageable pageable, boolean isRecruiting) { .join(qArticle.user, qUser) .fetchJoin() .orderBy(qArticle.createDate.desc()) - .where(qArticle.isDeleted.eq(false)) + .where(eqDelete(false),eqRecruiting(true)) .offset(pageable.getOffset()) .limit(pageable.getPageSize()) .distinct(); - if (isRecruiting) { - articleQuery = articleQuery.where(qArticle.isRecruiting.eq(true)); - } - List
articleList = articleQuery.fetch(); return new PageImpl<>(articleList); @@ -57,30 +59,17 @@ public Page
getArticleByFilter(Pageable pageable, boolean isRecruiting, .join(qArticle.user, qUser) .fetchJoin() .orderBy(qArticle.createDate.desc()) - .where(qArticle.isDeleted.eq(false)) + .where(eqDelete(false) + ,eqRecruiting(true) + ,eqGender(gender) + ,eqPeriod(period) + ,eqRegion(region) + ,loePrice(price)) .offset(pageable.getOffset()) .limit(pageable.getPageSize()) .distinct(); - if (isRecruiting) { - articleQuery = articleQuery.where(qArticle.isRecruiting.eq(true)); - } - - if (!"상관 없음".equals(region)) { - articleQuery = articleQuery.where(qArticle.region.eq(Seoul.fromValue(region))); - } - if (!"상관 없음".equals(period)) { - articleQuery = articleQuery.where(qArticle.period.eq(Period.fromValue(period))); - } - - if (!"상관 없음".equals(price)) { - articleQuery = articleQuery.where(qArticle.price.loe(Integer.parseInt(price))); - } - - if (!"상관 없음".equals(gender)) { - articleQuery = articleQuery.where(qArticle.gender.eq(Gender.fromValue(gender))); - } List
articleList = articleQuery.fetch(); @@ -91,7 +80,7 @@ public Page
getArticleByFilter(Pageable pageable, boolean isRecruiting, public Integer getArticleTotalCnt() { return Math.toIntExact(queryFactory.select(qArticle.count()) .from(qArticle) - .where(qArticle.isDeleted.eq(false)) + .where(eqDelete(false)) .fetchFirst()); } @@ -100,7 +89,7 @@ public List getMyArticle(User user) { var getMyArticleQuery=queryFactory.selectFrom(qArticle) .join(qArticle.user ,qUser) .fetchJoin() - .where(qUser.eq(user).and(qArticle.isDeleted.eq(false))) + .where(qUser.eq(user).and(eqDelete(false))) .orderBy(qArticle.isRecruiting.desc() ,qArticle.createDate.desc()); return getMyArticleQuery.fetch() .stream().map(MyArticleDto::toDto) @@ -114,7 +103,7 @@ public List getFavoriteArticle(User user){ .from(qLikeArticle) .join(qLikeArticle.article,qArticle) .join(qLikeArticle.user,qUser) - .where(qUser.eq(user).and(qArticle.isDeleted.eq(false))); + .where(qUser.eq(user),eqDelete(false)); return getMyFavoriteArticleQuery.fetch() .stream().map(FavoriteArticleDto::toDto) @@ -126,13 +115,30 @@ public List getUserArticle(User user) { var getUserArticleQuery = queryFactory.selectFrom(qArticle) .join(qArticle.user, qUser) .fetchJoin() - .where(qUser.eq(user) - .and(qArticle.isDeleted.eq(false)) - .and(qArticle.isRecruiting.eq(true))) + .where(qUser.eq(user),eqDelete(false),eqRecruiting(true)) .orderBy(qArticle.createDate.desc()); return getUserArticleQuery.fetch() .stream().map(ArticleInfoDto::toDto) .collect(Collectors.toList()); } + + private BooleanExpression eqDelete(boolean deleted){ + return qArticle.isDeleted.eq(deleted); + } + private BooleanExpression eqRecruiting(boolean isRecruiting){ + return qArticle.isRecruiting.eq(isRecruiting); + } + private BooleanExpression eqPeriod(String period){ + return StringUtils.hasText(period)? qArticle.period.eq(Period.fromValue(period)):null; + } + private BooleanExpression eqGender(String gender){ + return StringUtils.hasText(gender)? qArticle.gender.eq(Gender.fromValue(gender)):null; + } + private BooleanExpression eqRegion(String region){ + return StringUtils.hasText(region)? qArticle.region.eq(Seoul.fromValue(region)):null; + } + private BooleanExpression loePrice(String price){ + return StringUtils.hasText(price)? qArticle.price.loe(Integer.parseInt(price)):null; + } } diff --git a/src/main/java/com/fab/banggabgo/repository/impl/UserRepositoryImpl.java b/src/main/java/com/fab/banggabgo/repository/impl/UserRepositoryImpl.java index 651dd64..2cab060 100644 --- a/src/main/java/com/fab/banggabgo/repository/impl/UserRepositoryImpl.java +++ b/src/main/java/com/fab/banggabgo/repository/impl/UserRepositoryImpl.java @@ -4,8 +4,10 @@ import com.fab.banggabgo.entity.QUser; import com.fab.banggabgo.entity.User; import com.fab.banggabgo.repository.UserRepositoryCustom; +import com.querydsl.core.types.dsl.BooleanExpression; import com.querydsl.core.types.dsl.Expressions; import com.querydsl.jpa.JPAExpressions; +import com.querydsl.jpa.JPQLQuery; import com.querydsl.jpa.impl.JPAQueryFactory; import java.util.List; import java.util.Optional; @@ -18,11 +20,12 @@ public class UserRepositoryImpl implements UserRepositoryCustom { QUser qUser = QUser.user; QArticle qArticle = QArticle.article; + @Override public Optional findByEmail(String email) { var query = queryFactory.selectFrom(qUser) .leftJoin(qUser.roles).fetchJoin() .leftJoin(qUser.tag).fetchJoin() - .where(qUser.email.eq(email)); + .where(eqEmail(email)); return Optional.ofNullable(query.fetchOne()); } @@ -35,18 +38,49 @@ public List getRecommend(User user, Integer size) { .and(qArticle.isRecruiting.eq(true))); var userQuery = queryFactory.selectFrom(qUser) - .where(qUser.gender.eq(user.getGender()) - .and(qUser.isSmoker.eq(user.getIsSmoker())) - .and(qUser.region.eq(user.getRegion())) - .and(qUser.activityTime.eq(user.getActivityTime())) - .and(qUser.minAge.eq(user.getMinAge())) - .and(qUser.maxAge.eq(user.getMaxAge())) - .and(qUser.id.ne(user.getId())) - .and(qUser.in(subQuery))) + .where(eqGender(user), + eqSmoker(user), + preferAge(user), + eqRegion(user), + neSelf(user), + eqActivityTime(user), + userInSubQuery(subQuery) + ) .orderBy(Expressions.numberTemplate(Double.class, "function('rand')").asc()) .limit(size); return userQuery.fetch(); } + BooleanExpression eqEmail(String email){ + return qUser.email.eq(email); + } + + BooleanExpression eqGender(User user) { + return qUser.gender.eq(user.getGender()); + } + + BooleanExpression eqSmoker(User user) { + return qUser.isSmoker.eq(user.getIsSmoker()); + } + + BooleanExpression preferAge(User user) { + return qUser.myAge.between(user.getMinAge(), user.getMaxAge()); + } + + BooleanExpression eqRegion(User user) { + return qUser.region.eq(user.getRegion()); + } + + BooleanExpression userInSubQuery(JPQLQuery sub_query) { + return qUser.in(sub_query); + } + + BooleanExpression neSelf(User user) { + return qUser.id.ne(user.getId()); + } + + BooleanExpression eqActivityTime(User user) { + return qUser.activityTime.eq(user.getActivityTime()); + } } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e563655..61ae68f 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -27,4 +27,7 @@ spring: enabled: true server: - port: 8080 \ No newline at end of file + port: 8080 +query: + default: + static: "상관 없음" \ No newline at end of file From 733ac026dfa6be84e60873b39ec5de8a2a8361b9 Mon Sep 17 00:00:00 2001 From: FeelingXD Date: Mon, 19 Jun 2023 23:17:13 +0900 Subject: [PATCH 5/7] =?UTF-8?q?refactor=20:=20=EA=B2=80=EC=83=89=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=EA=B0=92=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../banggabgo/repository/impl/ArticleRepositoryImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/fab/banggabgo/repository/impl/ArticleRepositoryImpl.java b/src/main/java/com/fab/banggabgo/repository/impl/ArticleRepositoryImpl.java index 4f2e975..5b2859a 100644 --- a/src/main/java/com/fab/banggabgo/repository/impl/ArticleRepositoryImpl.java +++ b/src/main/java/com/fab/banggabgo/repository/impl/ArticleRepositoryImpl.java @@ -130,15 +130,15 @@ private BooleanExpression eqRecruiting(boolean isRecruiting){ return qArticle.isRecruiting.eq(isRecruiting); } private BooleanExpression eqPeriod(String period){ - return StringUtils.hasText(period)? qArticle.period.eq(Period.fromValue(period)):null; + return StringUtils.hasText(period)&&!period.equals(default_option)? qArticle.period.eq(Period.fromValue(period)):null; } private BooleanExpression eqGender(String gender){ - return StringUtils.hasText(gender)? qArticle.gender.eq(Gender.fromValue(gender)):null; + return StringUtils.hasText(gender)&&!gender.equals(default_option)? qArticle.gender.eq(Gender.fromValue(gender)):null; } private BooleanExpression eqRegion(String region){ - return StringUtils.hasText(region)? qArticle.region.eq(Seoul.fromValue(region)):null; + return StringUtils.hasText(region)&&!region.equals(default_option)? qArticle.region.eq(Seoul.fromValue(region)):null; } private BooleanExpression loePrice(String price){ - return StringUtils.hasText(price)? qArticle.price.loe(Integer.parseInt(price)):null; + return StringUtils.hasText(price)&&!price.equals(default_option)? qArticle.price.loe(Integer.parseInt(price)):null; } } From 9f0daddabc6ba5e0640b096155a797b259177aa7 Mon Sep 17 00:00:00 2001 From: FeelingXD Date: Tue, 20 Jun 2023 01:19:18 +0900 Subject: [PATCH 6/7] test: Code Style --- .../controller/MyContentControllerTest.java | 68 +++++++++++-------- .../impl/MyContentServiceImplTest.java | 13 ++-- 2 files changed, 46 insertions(+), 35 deletions(-) diff --git a/src/test/java/com/fab/banggabgo/controller/MyContentControllerTest.java b/src/test/java/com/fab/banggabgo/controller/MyContentControllerTest.java index 55e69df..9772243 100644 --- a/src/test/java/com/fab/banggabgo/controller/MyContentControllerTest.java +++ b/src/test/java/com/fab/banggabgo/controller/MyContentControllerTest.java @@ -12,6 +12,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; @@ -143,35 +144,39 @@ class applicantList { @Test @DisplayName("신청자리스트 - 성공") @WithMockUser - void successGetApplicantList() throws Exception{ + void successGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/from-applicants?page=1&size=4") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isOk()); } + @Test @DisplayName("신청자리스트 - 성공 페이지 누락") @WithMockUser - void successLostPageGetApplicantList() throws Exception{ + void successLostPageGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/from-applicants?size=4") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isOk()); } + @Test @DisplayName("신청자리스트 - 성공 사이즈 누락") @WithMockUser - void successLostSizeGetApplicantList() throws Exception{ + void successLostSizeGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/from-applicants?page=1") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isOk()); } + @Test @DisplayName("신청자리스트 - 실패 계정 누락") - void FailNonAuthGetApplicantList() throws Exception{ + void FailNonAuthGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/from-applicants?page=1&size=4") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isUnauthorized()); } } + @Nested @DisplayName("내가신청한 신청자리스트") class toApplicantList { @@ -179,46 +184,51 @@ class toApplicantList { @Test @DisplayName("신청한리스트 - 성공") @WithMockUser - void successGetApplicantList() throws Exception{ + void successGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/to-applicants?page=1&size=4") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isOk()); } + @Test @DisplayName("신청한리스트 - 성공 페이지 누락") @WithMockUser - void successLostPageGetApplicantList() throws Exception{ + void successLostPageGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/to-applicants?size=4") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isOk()); } + @Test @DisplayName("신청한리스트 - 성공 사이즈 누락") @WithMockUser - void successLostSizeGetApplicantList() throws Exception{ + void successLostSizeGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/to-applicants?page=1") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isOk()); } + @Test @DisplayName("신청한리스트 - 실패 계정 누락") - void FailNonAuthGetApplicantList() throws Exception{ + void FailNonAuthGetApplicantList() throws Exception { mockMvc.perform(get("/api/my/to-applicants?page=1&size=4") - .with(SecurityMockMvcRequestPostProcessors.csrf())) + .with(SecurityMockMvcRequestPostProcessors.csrf())) .andExpect(status().isUnauthorized()); } - - @Test - @DisplayName("이미지 변경 테스트") - @WithMockUser - void postMyImg() throws Exception { - Path imagePath = Paths.get("src/test/resources/wierd.png"); - byte[] imageBytes = Files.readAllBytes(imagePath); - var image = new MockMultipartFile("image", "wierd.png", MediaType.IMAGE_PNG_VALUE, imageBytes); - mockMvc.perform(MockMvcRequestBuilders.multipart("/api/my/image") - .file(image) - .with(SecurityMockMvcRequestPostProcessors.csrf()) - ) - .andExpect(status().isOk()); + + @Test + @DisplayName("이미지 변경 테스트") + @WithMockUser + void postMyImg() throws Exception { + Path imagePath = Paths.get("src/test/resources/wierd.png"); + byte[] imageBytes = Files.readAllBytes(imagePath); + var image = new MockMultipartFile("image", "wierd.png", MediaType.IMAGE_PNG_VALUE, + imageBytes); + mockMvc.perform(MockMvcRequestBuilders.multipart("/api/my/image") + .file(image) + .with(SecurityMockMvcRequestPostProcessors.csrf()) + ) + .andExpect(status().isOk()); + } } } \ No newline at end of file diff --git a/src/test/java/com/fab/banggabgo/service/impl/MyContentServiceImplTest.java b/src/test/java/com/fab/banggabgo/service/impl/MyContentServiceImplTest.java index 04a29f9..d684da1 100644 --- a/src/test/java/com/fab/banggabgo/service/impl/MyContentServiceImplTest.java +++ b/src/test/java/com/fab/banggabgo/service/impl/MyContentServiceImplTest.java @@ -278,11 +278,11 @@ class fromApplicant { void getApplicantsSuccess() { when(applyRepository.getMyApplicant(any(), anyInt())).thenReturn(List.of(Apply.builder() - .approveStatus(ApproveStatus.WAIT) - .article(article) - .applicantUser(appliedUser) - .approveStatus(ApproveStatus.WAIT) - .build())); + .approveStatus(ApproveStatus.WAIT) + .article(article) + .applicantUser(appliedUser) + .approveStatus(ApproveStatus.WAIT) + .build())); var result = myContentService.getMyFromApplicantList(loginUser, 4, 1); @@ -292,7 +292,8 @@ void getApplicantsSuccess() { assertEquals(result.get(0).getArticleId(), article.getId()); assertEquals(result.get(0).getOtherUserName(), appliedUser.getNickname()); assertEquals(result.get(0).getOtherUserId(), appliedUser.getId()); - + } + @Test @DisplayName("이미지 업로드하기") void postImage() throws IOException { From 764d038dfd8f5a189be5ae83668cded906ec7147 Mon Sep 17 00:00:00 2001 From: FeelingXD Date: Tue, 20 Jun 2023 01:21:42 +0900 Subject: [PATCH 7/7] fix : typo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sws -> aws 오타수정 --- src/main/resources/aws-example.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/aws-example.yml b/src/main/resources/aws-example.yml index 02397e0..9ac2d60 100644 --- a/src/main/resources/aws-example.yml +++ b/src/main/resources/aws-example.yml @@ -1,5 +1,5 @@ cloud: - sws: + aws: s3: bucket: your-bucket! credentials: