From e9ebdf84667a1e5fa3e52420462a8fc46434ac03 Mon Sep 17 00:00:00 2001 From: "Andy H. Jung" Date: Fri, 23 Oct 2020 11:30:23 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20Jacoco=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Member의 Builder 삭제, OAuthAttributes에서 Member의 Builder 사용부분 삭제 --- build.gradle | 29 +++++++++++++++++++ lombok.config | 1 + .../com/saebyeok/saebyeok/domain/Member.java | 9 ++++-- .../security/dto/OAuthAttributes.java | 6 +--- 4 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 lombok.config diff --git a/build.gradle b/build.gradle index fdf47355..b11ef960 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,7 @@ plugins { id "org.sonarqube" version "2.7" id "com.moowork.node" version "1.3.1" id 'java' + id 'jacoco' } node { @@ -29,6 +30,10 @@ repositories { mavenCentral() } +jacoco { + toolVersion = "0.8.5" +} + ext { set('snippetsDir', file("build/generated-snippets")) } @@ -57,6 +62,29 @@ dependencies { testImplementation 'io.rest-assured:spring-mock-mvc:3.3.0' } +jacocoTestReport { + reports { + html.enabled true + csv.enabled true + xml.enabled false + } + finalizedBy 'jacocoTestCoverageVerification' +} + +jacocoTestCoverageVerification { + violationRules { + rule { + element = 'CLASS' + + limit { + counter = 'BRANCH' + value = 'COVEREDRATIO' + minimum = 0.00 + } + } + } +} + ext { snippetsDir = file('build/generated-snippets') } @@ -64,6 +92,7 @@ ext { test { useJUnitPlatform() outputs.dir snippetsDir + finalizedBy 'jacocoTestReport' } asciidoctor { diff --git a/lombok.config b/lombok.config new file mode 100644 index 00000000..7a21e880 --- /dev/null +++ b/lombok.config @@ -0,0 +1 @@ +lombok.addLombokGeneratedAnnotation = true diff --git a/src/main/java/com/saebyeok/saebyeok/domain/Member.java b/src/main/java/com/saebyeok/saebyeok/domain/Member.java index 1118e2a3..ab248308 100644 --- a/src/main/java/com/saebyeok/saebyeok/domain/Member.java +++ b/src/main/java/com/saebyeok/saebyeok/domain/Member.java @@ -12,7 +12,6 @@ import java.util.ArrayList; import java.util.List; -@Builder @Getter @AllArgsConstructor @NoArgsConstructor @@ -28,7 +27,6 @@ public class Member { @CreatedDate private LocalDateTime createdDate; - @Builder.Default private Boolean isDeleted = Boolean.FALSE; @Enumerated(EnumType.STRING) @@ -36,9 +34,14 @@ public class Member { private Role role; @OneToMany(mappedBy = "member") - @Builder.Default private List
articles = new ArrayList<>(); + public Member(String oauthId, String loginMethod, Role role) { + this.oauthId = oauthId; + this.loginMethod = loginMethod; + this.role = role; + } + public String getRoleKey() { return this.role.getKey(); } diff --git a/src/main/java/com/saebyeok/saebyeok/security/dto/OAuthAttributes.java b/src/main/java/com/saebyeok/saebyeok/security/dto/OAuthAttributes.java index 4ffb5ef5..5b3fda2e 100644 --- a/src/main/java/com/saebyeok/saebyeok/security/dto/OAuthAttributes.java +++ b/src/main/java/com/saebyeok/saebyeok/security/dto/OAuthAttributes.java @@ -53,10 +53,6 @@ private static OAuthAttributes ofNaver(String userNameAttributeName, Map