Skip to content

Commit

Permalink
chore: Jacoco 관련 설정 추가
Browse files Browse the repository at this point in the history
- Member의 Builder 삭제, OAuthAttributes에서 Member의 Builder 사용부분 삭제
  • Loading branch information
hotheadfactory committed Oct 23, 2020
1 parent 0b21c55 commit e9ebdf8
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
29 changes: 29 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id "org.sonarqube" version "2.7"
id "com.moowork.node" version "1.3.1"
id 'java'
id 'jacoco'
}

node {
Expand All @@ -29,6 +30,10 @@ repositories {
mavenCentral()
}

jacoco {
toolVersion = "0.8.5"
}

ext {
set('snippetsDir', file("build/generated-snippets"))
}
Expand Down Expand Up @@ -57,13 +62,37 @@ 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')
}

test {
useJUnitPlatform()
outputs.dir snippetsDir
finalizedBy 'jacocoTestReport'
}

asciidoctor {
Expand Down
1 change: 1 addition & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.addLombokGeneratedAnnotation = true
9 changes: 6 additions & 3 deletions src/main/java/com/saebyeok/saebyeok/domain/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.ArrayList;
import java.util.List;

@Builder
@Getter
@AllArgsConstructor
@NoArgsConstructor
Expand All @@ -28,17 +27,21 @@ public class Member {
@CreatedDate
private LocalDateTime createdDate;

@Builder.Default
private Boolean isDeleted = Boolean.FALSE;

@Enumerated(EnumType.STRING)
@Column(nullable = false)
private Role role;

@OneToMany(mappedBy = "member")
@Builder.Default
private List<Article> 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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ private static OAuthAttributes ofNaver(String userNameAttributeName, Map<String,
}

public Member toEntity() {
return Member.builder()
.oauthId(id)
.loginMethod(loginMethod)
.role(Role.USER)
.build();
return new Member(id, loginMethod, Role.USER);
}
}

0 comments on commit e9ebdf8

Please sign in to comment.