-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/woowacourse-teams/2021-cvi…
… into develop
- Loading branch information
Showing
32 changed files
with
1,168 additions
and
536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...end/domain-cvi-publicdata-service/src/test/java/com/cvi/service/CacheEventLoggerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.cvi.service; | ||
|
||
import org.ehcache.event.CacheEvent; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.mockito.BDDMockito.willReturn; | ||
import static org.mockito.Mockito.*; | ||
|
||
@DisplayName("CacheEventLogger 기능 테스트") | ||
class CacheEventLoggerTest { | ||
|
||
@DisplayName("이벤트 호출 확인 - 성공") | ||
@Test | ||
void onEvent() { | ||
//given | ||
CacheEventLogger cacheEventLogger = new CacheEventLogger(); | ||
final CacheEvent cacheEvent = mock(CacheEvent.class); | ||
//when | ||
willReturn(1L).given(cacheEvent).getKey(); | ||
willReturn("이전 캐시").given(cacheEvent).getOldValue(); | ||
willReturn("새로운 캐시").given(cacheEvent).getNewValue(); | ||
cacheEventLogger.onEvent(cacheEvent); | ||
//then | ||
verify(cacheEvent, times(1)).getKey(); | ||
verify(cacheEvent, times(1)).getOldValue(); | ||
verify(cacheEvent, times(1)).getNewValue(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[ | ||
{ | ||
"content": "test1", | ||
"createdAt": "2021-07-27T14:56:43.633", | ||
"id": 1, | ||
"vaccinationType": "ASTRAZENECA", | ||
"viewCount": 0, | ||
"likeCount": 3, | ||
"commentCount": 4, | ||
"writer": { | ||
"accessToken": null, | ||
"ageRange": { | ||
"maxAge": 20, | ||
"meaning": "10대", | ||
"minAge": 10 | ||
}, | ||
"id": 1, | ||
"nickname": "검프", | ||
"socialId": null, | ||
"socialProfileUrl": null, | ||
"socialProvider": null | ||
} | ||
}, | ||
{ | ||
"content": "test7", | ||
"createdAt": "2021-07-27T14:56:43.633", | ||
"id": 7, | ||
"vaccinationType": "ASTRAZENECA", | ||
"viewCount": 0, | ||
"likeCount": 35, | ||
"commentCount": 40, | ||
"writer": { | ||
"accessToken": null, | ||
"ageRange": { | ||
"maxAge": 20, | ||
"meaning": "10대", | ||
"minAge": 10 | ||
}, | ||
"id": 1, | ||
"nickname": "검프", | ||
"socialId": null, | ||
"socialProfileUrl": null, | ||
"socialProvider": null | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"content": "다음날 되니 좀 아픈것 같아요 ㅠ ㅠ", | ||
"createdAt": "2021-07-28T14:56:43.633", | ||
"id": 8, | ||
"vaccinationType": "MODERNA", | ||
"viewCount": 0, | ||
"likeCount": 310, | ||
"commentCount": 20, | ||
"writer": { | ||
"accessToken": "accessToken", | ||
"ageRange": { | ||
"maxAge": 30, | ||
"meaning": "20대", | ||
"minAge": 20 | ||
}, | ||
"id": 8, | ||
"nickname": "nickname", | ||
"socialId": "socialId", | ||
"socialProfileUrl": "http://k.kakaocdn.net/dn/xGvcl/btranGk6QWP/uvRGXQeokXgIhPRD0wTPgk/img_640x640.jpg", | ||
"socialProvider": "KAKAO" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[ | ||
{ | ||
"content": "test5", | ||
"createdAt": "2021-07-27T14:56:43.633", | ||
"id": 5, | ||
"vaccinationType": "JANSSEN", | ||
"viewCount": 0, | ||
"likeCount": 36, | ||
"commentCount": 24, | ||
"writer": { | ||
"accessToken": null, | ||
"ageRange": { | ||
"maxAge": 20, | ||
"meaning": "10대", | ||
"minAge": 10 | ||
}, | ||
"id": 1, | ||
"nickname": "검프", | ||
"socialId": null, | ||
"socialProfileUrl": null, | ||
"socialProvider": null | ||
} | ||
}, | ||
{ | ||
"content": "test6", | ||
"createdAt": "2021-07-27T14:56:43.633", | ||
"id": 6, | ||
"vaccinationType": "JANSSEN", | ||
"viewCount": 0, | ||
"likeCount": 13, | ||
"commentCount": 43, | ||
"writer": { | ||
"accessToken": null, | ||
"ageRange": { | ||
"maxAge": 20, | ||
"meaning": "10대", | ||
"minAge": 10 | ||
}, | ||
"id": 1, | ||
"nickname": "검프", | ||
"socialId": null, | ||
"socialProfileUrl": null, | ||
"socialProvider": null | ||
} | ||
} | ||
] |
Oops, something went wrong.