-
Notifications
You must be signed in to change notification settings - Fork 4
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
커넥션풀 관련 설정 추가 + 회원탈퇴시 fk 관련 삭제 로직 추가 #784
Changes from all commits
983762e
d3a29da
ba0b65c
8bb0a9c
2abc0a6
21de272
f1aa59e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,10 @@ spring: | |
url: ${DATASOURCE_URL} | ||
username: ${DATASOURCE_USERNAME} | ||
password: ${DATASOURCE_PASSWORD} | ||
hikari: | ||
maximumPoolSize: ${MAXIMUM_POOL_SIZE} | ||
connectionTimeout: ${CONNECTION_TIMEOUT} | ||
maxLifetime: ${MAX_LIFETIME} | ||
Comment on lines
+7
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이외의 설정도 많았던 것 같은데 3개의 설정만 해주시는 이유가 있나요?! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 그 이외의 설정값들은 default값이여서 따로 설정은 하지 않았습니다! |
||
|
||
jpa: | ||
database-platform: org.hibernate.dialect.MySQLDialect | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ | |
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; | ||
import org.springframework.boot.test.mock.mockito.MockBean; | ||
import org.springframework.core.ParameterizedTypeReference; | ||
import org.springframework.http.HttpHeaders; | ||
import org.springframework.http.HttpStatus; | ||
|
||
|
@@ -90,12 +89,14 @@ void getReportAlarmActions() { | |
|
||
// when | ||
List<ReportActionAlarmResponse> results = RestAssuredMockMvc | ||
.given().log().all() | ||
.queryParam("page", 0) | ||
.when().get("/alarms/report?page=0") | ||
.then().log().all() | ||
.status(HttpStatus.OK) | ||
.extract() | ||
.as(new ParameterizedTypeReference<List<ReportActionAlarmResponse>>() { | ||
}.getType()); | ||
.as(new TypeRef<>() { | ||
}); | ||
Comment on lines
-97
to
+99
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 👍 |
||
|
||
// then | ||
assertThat(results.get(0)).isEqualTo(response); | ||
|
@@ -117,6 +118,7 @@ void getReportAlarmAction() { | |
|
||
// when | ||
ReportActionResponse result = RestAssuredMockMvc | ||
.given().log().all() | ||
.when().get("/alarms/report/{id}", 1) | ||
.then().log().all() | ||
.status(HttpStatus.OK) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,8 @@ | |
import static org.assertj.core.api.SoftAssertions.assertSoftly; | ||
import static org.junit.jupiter.api.Assertions.assertAll; | ||
|
||
import com.votogether.domain.alarm.entity.ReportActionAlarm; | ||
import com.votogether.domain.alarm.repository.ReportActionAlarmRepository; | ||
import com.votogether.domain.category.entity.Category; | ||
import com.votogether.domain.category.repository.CategoryRepository; | ||
import com.votogether.domain.member.dto.request.MemberDetailRequest; | ||
|
@@ -16,6 +18,8 @@ | |
import com.votogether.domain.member.repository.MemberCategoryRepository; | ||
import com.votogether.domain.member.repository.MemberMetricRepository; | ||
import com.votogether.domain.member.repository.MemberRepository; | ||
import com.votogether.domain.notice.entity.Notice; | ||
import com.votogether.domain.notice.repository.NoticeRepository; | ||
import com.votogether.domain.post.entity.Post; | ||
import com.votogether.domain.post.entity.comment.Comment; | ||
import com.votogether.domain.post.repository.CommentRepository; | ||
|
@@ -67,6 +71,12 @@ class MemberServiceTest extends ServiceTest { | |
@Autowired | ||
PostTestPersister postTestPersister; | ||
|
||
@Autowired | ||
ReportActionAlarmRepository reportActionAlarmRepository; | ||
|
||
@Autowired | ||
NoticeRepository noticeRepository; | ||
|
||
@Autowired | ||
EntityManager em; | ||
|
||
|
@@ -481,6 +491,55 @@ void deleteWithReportedNickname() { | |
); | ||
} | ||
|
||
@Test | ||
@DisplayName("회원과 신고조치알림 모두 삭제된다.") | ||
void deleteWithReportActionAlarms() { | ||
// given | ||
Member member = memberRepository.save(MemberFixtures.MALE_20.get()); | ||
|
||
ReportActionAlarm reportActionAlarm = ReportActionAlarm.builder() | ||
.reportType(ReportType.POST) | ||
.member(member) | ||
.isChecked(false) | ||
.target("1") | ||
.reasons("광고성, 부적합성") | ||
.build(); | ||
reportActionAlarmRepository.save(reportActionAlarm); | ||
|
||
// when | ||
memberService.deleteMember(member); | ||
|
||
// then | ||
assertAll( | ||
() -> assertThat(memberRepository.findAll()).isEmpty(), | ||
() -> assertThat(reportActionAlarmRepository.findAll()).isEmpty() | ||
); | ||
Comment on lines
+513
to
+516
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. assertAll 대신 assertSoftly 써보는 것은 어떨까요. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 네 수정하도록 할께요~ |
||
} | ||
|
||
@Test | ||
@DisplayName("회원과 작성한 공지사항 모두 삭제된다.") | ||
void deleteWithNotices() { | ||
// given | ||
Member member = memberRepository.save(MemberFixtures.MALE_20.get()); | ||
|
||
Notice notice = Notice.builder() | ||
.member(member) | ||
.title("title") | ||
.content("content") | ||
.deadline(LocalDateTime.now().plusDays(1)) | ||
.build(); | ||
noticeRepository.save(notice); | ||
|
||
// when | ||
memberService.deleteMember(member); | ||
|
||
// then | ||
assertAll( | ||
() -> assertThat(memberRepository.findAll()).isEmpty(), | ||
() -> assertThat(noticeRepository.findAll()).isEmpty() | ||
); | ||
} | ||
|
||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
공지사항까지 챙겨주셔서 감사합니다 👍🏻