testcase update & sonarqube plugin add
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'org.springframework.boot' version '2.4.5'
|
id 'org.springframework.boot' version '2.4.5'
|
||||||
|
id "org.sonarqube" version "2.7"
|
||||||
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
||||||
// querydsl
|
// querydsl
|
||||||
id 'com.ewerk.gradle.plugins.querydsl' version '1.0.10'
|
id 'com.ewerk.gradle.plugins.querydsl' version '1.0.10'
|
||||||
|
|||||||
@@ -203,7 +203,9 @@ public class PostsService extends AbstractService {
|
|||||||
/**
|
/**
|
||||||
* 첨부파일 entity 정보 저장 이벤트 발생
|
* 첨부파일 entity 정보 저장 이벤트 발생
|
||||||
*/
|
*/
|
||||||
sendAttachmentEvent(entity);
|
if (StringUtils.hasText(entity.getAttachmentCode())) {
|
||||||
|
sendAttachmentEvent(entity);
|
||||||
|
}
|
||||||
|
|
||||||
return new PostsResponseDto(entity);
|
return new PostsResponseDto(entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,14 +18,20 @@ import org.egovframe.cloud.boardservice.domain.board.BoardRepository;
|
|||||||
import org.egovframe.cloud.boardservice.domain.posts.Posts;
|
import org.egovframe.cloud.boardservice.domain.posts.Posts;
|
||||||
import org.egovframe.cloud.boardservice.domain.posts.PostsId;
|
import org.egovframe.cloud.boardservice.domain.posts.PostsId;
|
||||||
import org.egovframe.cloud.boardservice.domain.posts.PostsRepository;
|
import org.egovframe.cloud.boardservice.domain.posts.PostsRepository;
|
||||||
|
import org.egovframe.cloud.boardservice.service.posts.PostsService;
|
||||||
import org.egovframe.cloud.boardservice.util.RestResponsePage;
|
import org.egovframe.cloud.boardservice.util.RestResponsePage;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.mockito.ArgumentMatchers;
|
||||||
|
import org.mockito.InjectMocks;
|
||||||
|
import org.mockito.Mock;
|
||||||
|
import org.mockito.Mockito;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||||
|
import org.springframework.cloud.stream.function.StreamBridge;
|
||||||
import org.springframework.core.ParameterizedTypeReference;
|
import org.springframework.core.ParameterizedTypeReference;
|
||||||
import org.springframework.http.HttpEntity;
|
import org.springframework.http.HttpEntity;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
@@ -428,7 +434,6 @@ class PostsApiControllerTest {
|
|||||||
params.put("postsTitle", INSERT_POSTS_TITLE);
|
params.put("postsTitle", INSERT_POSTS_TITLE);
|
||||||
params.put("postsContent", INSERT_POSTS_CONTENT);
|
params.put("postsContent", INSERT_POSTS_CONTENT);
|
||||||
params.put("postsAnswerContent", INSERT_POSTS_ANSWER_CONTENT);
|
params.put("postsAnswerContent", INSERT_POSTS_ANSWER_CONTENT);
|
||||||
params.put("attachmentCode", INSERT_ATTACHMENT_CODE);
|
|
||||||
params.put("noticeAt", INSERT_NOTICE_AT);
|
params.put("noticeAt", INSERT_NOTICE_AT);
|
||||||
HttpEntity<Map<String, Object>> httpEntity = new HttpEntity<>(params);
|
HttpEntity<Map<String, Object>> httpEntity = new HttpEntity<>(params);
|
||||||
|
|
||||||
@@ -459,7 +464,6 @@ class PostsApiControllerTest {
|
|||||||
assertThat(entity.getPostsTitle()).isEqualTo(INSERT_POSTS_TITLE);
|
assertThat(entity.getPostsTitle()).isEqualTo(INSERT_POSTS_TITLE);
|
||||||
assertThat(entity.getPostsContent()).isEqualTo(INSERT_POSTS_CONTENT);
|
assertThat(entity.getPostsContent()).isEqualTo(INSERT_POSTS_CONTENT);
|
||||||
assertThat(entity.getPostsAnswerContent()).isEqualTo(INSERT_POSTS_ANSWER_CONTENT);
|
assertThat(entity.getPostsAnswerContent()).isEqualTo(INSERT_POSTS_ANSWER_CONTENT);
|
||||||
assertThat(entity.getAttachmentCode()).isEqualTo(INSERT_ATTACHMENT_CODE);
|
|
||||||
assertThat(entity.getReadCount()).isZero();
|
assertThat(entity.getReadCount()).isZero();
|
||||||
assertThat(entity.getNoticeAt()).isEqualTo(INSERT_NOTICE_AT);
|
assertThat(entity.getNoticeAt()).isEqualTo(INSERT_NOTICE_AT);
|
||||||
assertThat(entity.getDeleteAt()).isZero();
|
assertThat(entity.getDeleteAt()).isZero();
|
||||||
|
|||||||
Reference in New Issue
Block a user