File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed
src/test/java/com/somemore/center/domain Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ dependencies {
5757 annotationProcessor ' org.projectlombok:lombok'
5858 implementation group : ' org.springdoc' , name : ' springdoc-openapi-starter-webmvc-ui' , version : ' 2.6.0'
5959
60-
6160 // test
6261 testImplementation ' org.springframework.boot:spring-boot-starter-test'
6362 testImplementation ' org.springframework.security:spring-security-test'
@@ -105,6 +104,7 @@ def jacocoExcludePatterns = [
105104 ' **/*Response*' ,
106105 ' **/*Entity*' ,
107106 ' **/*Dto*' ,
107+ ' **/*Dto.*' ,
108108 ' **/*Jwt*' ,
109109 ' **/auth/*' ,
110110 ' **/domain/*' ,
@@ -179,6 +179,7 @@ sonar {
179179 property ' sonar.language' , ' java'
180180 property ' sonar.sourceEncoding' , ' UTF-8'
181181 property ' sonar.test.exclusions' , jacocoExcludePatterns. join(' ,' )
182+ property ' sonar.coverage.exclusions' , jacocoExcludePatterns. join(' ,' )
182183 property ' sonar.test.inclusions' , ' **/*Test.java'
183184 property ' sonar.java.coveragePlugin' , ' jacoco'
184185 property ' sonar.coverage.jacoco.xmlReportPaths' , jacocoDir. get(). file(" jacoco/index.xml" ). asFile
Original file line number Diff line number Diff line change 1+ package com .somemore .center .domain ;
2+
3+ import org .junit .jupiter .api .DisplayName ;
4+ import org .junit .jupiter .api .Test ;
5+
6+ import static org .assertj .core .api .AssertionsForClassTypes .assertThat ;
7+ import static org .junit .jupiter .api .Assertions .*;
8+
9+ class CenterTest {
10+
11+ private static final String NAME = "서울 도서관" ;
12+ private static final String CONTACT_NUMBER = "02-1234-5678" ;
13+ private static final String IMG_URL = "http://example.com/image.jpg" ;
14+ private static final String INTRODUCE = "우리는 서울 도서관입니다." ;
15+ private static final String HOMEPAGE_LINK = "http://testcenter.com" ;
16+ private static final String ACCOUNT_ID = "testId" ;
17+ private static final String ACCOUNT_PW = "testPw" ;
18+
19+ @ DisplayName ("Center 엔티티를 생성할 수 있다." )
20+ @ Test
21+ void create () {
22+ //when
23+ Center center = Center .create (
24+ NAME ,
25+ CONTACT_NUMBER ,
26+ IMG_URL ,
27+ INTRODUCE ,
28+ HOMEPAGE_LINK ,
29+ ACCOUNT_ID ,
30+ ACCOUNT_PW
31+ );
32+
33+ //then
34+ assertAll (
35+ () -> assertThat (center .getName ()).isEqualTo (NAME ),
36+ () -> assertThat (center .getContactNumber ()).isEqualTo (CONTACT_NUMBER ),
37+ () -> assertThat (center .getImgUrl ()).isEqualTo (IMG_URL ),
38+ () -> assertThat (center .getIntroduce ()).isEqualTo (INTRODUCE ),
39+ () -> assertThat (center .getHomepageLink ()).isEqualTo (HOMEPAGE_LINK ),
40+ () -> assertThat (center .getAccountId ()).isEqualTo (ACCOUNT_ID ),
41+ () -> assertThat (center .getAccountPw ()).isEqualTo (ACCOUNT_PW )
42+ );
43+ }
44+
45+
46+ }
You can’t perform that action at this time.
0 commit comments