-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38b966d
commit e569c30
Showing
12 changed files
with
79 additions
and
19 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
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
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 |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.stream.Collectors; | ||
|
||
|
||
@Slf4j | ||
|
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
50 changes: 50 additions & 0 deletions
50
src/test/java/darkoverload/itzip/feature/job/service/connect/JobInfoScheduleTest.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,50 @@ | ||
package darkoverload.itzip.feature.job.service.connect; | ||
|
||
import darkoverload.itzip.feature.job.domain.JobInfo; | ||
import darkoverload.itzip.feature.job.entity.JobInfoEntity; | ||
import darkoverload.itzip.feature.job.repository.JobInfoRepository; | ||
import darkoverload.itzip.feature.job.service.JobInfoService; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
|
||
import java.util.List; | ||
|
||
@Slf4j | ||
@SpringBootTest | ||
@ActiveProfiles(profiles = "test") | ||
public class JobInfoScheduleTest { | ||
|
||
@Autowired | ||
private JobInfoRepository jobInfoRepository; | ||
|
||
@Autowired | ||
private JobInfoConnectService service; | ||
|
||
@Test | ||
void 사람인_테스트() { | ||
// 데이터베이스에서 모든 JobInfo 데이터를 조회하고, 도메인 객체 리스트로 변환 | ||
List<JobInfo> dbList = jobInfoRepository.findAll().stream().map(JobInfoEntity::convertToDomain).toList(); | ||
|
||
// Saramin API를 호출하여 최신 JobInfo 데이터를 가져옴 | ||
List<JobInfo> apiDataList = service.jobInfoConnect(); | ||
|
||
// 데이터베이스에 있는 JobInfo 데이터를 API 데이터와 비교하여 삭제 작업 수행 | ||
Long deletedCount = service.jobInfoDelete(apiDataList, dbList); | ||
|
||
log.info("==== Saramin API Data deleteCount :: {} ====", deletedCount); | ||
|
||
// 데이터베이스에 있는 JobInfo 데이터를 API 데이터와 비교하여 업데이트 작업 수행 | ||
Long updatedCount = service.jobInfoUpdate(apiDataList, dbList); | ||
|
||
log.info("==== Saramin API Data updateCount :: {} ====", updatedCount); | ||
|
||
// API 데이터 중에서 데이터베이스에 없는 데이터를 삽입하는 작업 수행 | ||
Long savedCount = service.jobInfoSave(apiDataList, dbList); | ||
|
||
log.info("==== Saramin API Data updateCount :: {} ====", savedCount); | ||
} | ||
|
||
} |
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