diff --git a/src/test/java/org/scoula/service/AptServiceTest.java b/src/test/java/org/scoula/service/AptServiceTest.java deleted file mode 100644 index 2b7acf5..0000000 --- a/src/test/java/org/scoula/service/AptServiceTest.java +++ /dev/null @@ -1,121 +0,0 @@ -package org.scoula.service; - -import lombok.extern.log4j.Log4j2; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.scoula.config.RootConfig; -import org.scoula.dto.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit.jupiter.SpringExtension; - -import static org.junit.jupiter.api.Assertions.*; - -@ExtendWith(SpringExtension.class) -@ContextConfiguration(classes = { AptService.class, RootConfig.class }) // AptService만 테스트 -@Log4j2 -class -AptServiceTest { - - @Autowired - private AptService aptService; - - @Test - void fetchAptData() { - AptResponseDTO response = aptService.fetchAptData(1, 1); - log.info("전체 응답 {}",response); - - if (response != null && response.getData() != null) { - for (AptDTO apt : response.getData()) { - log.info("Apt: {} \n", apt); - } - } - } - - @Test - void getAllAptData() { - AptResponseDTO response = aptService.fetchAptData(1,1); - Integer match_count = response.getMatchCount(); - log.info("Match!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!{}",match_count); - AptResponseDTO response2 = aptService.fetchAptData(1,match_count); - if (response2 != null && response2.getData() != null) { - for (AptDTO apt : response2.getData()) { - log.info("Apt: {} \n", apt); - } - } - } - - @Test - void saveAptData() { - AptResponseDTO response = aptService.fetchAptData(1,1); - Integer match_count = response.getMatchCount(); - log.info("Match!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!{}",match_count); - if (match_count > 1) { - response = aptService.fetchAptData(1, match_count); - } - aptService.saveAptData(response); - if (response != null && response.getData() != null) { - for (AptDTO apt : response.getData()) { - log.info("저장된 APT: {}", apt); - } - } else { - fail("response 또는 data가 null입니다."); - } - } - - @Test - void getAptTypeData() { - AptTypeResponseDTO response = aptService.fetchAptTypeData("2025000326"); - log.info("전체 응답 {}",response); - - if (response != null && response.getData() != null) { - for (AptTypeDTO apt : response.getData()) { - log.info("Apt: {} \n", apt); - } - } - - } - - @Test - void getAllAptTypeData() { - AptTypeResponseDTO response = aptService.fetchAptTypeData("2024000694"); - Integer current_count = response.getCurrentCount(); - log.info("Current!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! : {}",current_count); - } - - @Test - void syncAptData() { - aptService.syncAptData(); - } - - @Test - void getAptDetail() { - AptDetailDTO detail = aptService.getAptDetail("2025000306"); - log.info("AptDetailDTO {"); - log.info(" houseManageNo: {}", detail.getHouseManageNo()); - log.info(" pblancNo: {}", detail.getPblancNo()); - log.info(" houseNm: {}", detail.getHouseNm()); - log.info(" houseSecdNm: {}", detail.getHouseSecdNm()); - log.info(" rentSecdNm: {}", detail.getRentSecdNm()); - log.info(" hssplyAdres: {}", detail.getHssplyAdres()); - log.info(" totSuplyHshldco: {}", detail.getTotSuplyHshldco()); - log.info(" rcritPblancDe: {}", detail.getRcritPblancDe()); - log.info(" cnstrctEntrpsNm: {}", detail.getCnstrctEntrpsNm()); - log.info(" aptType: ["); - - for (AptTypeDTO type : detail.getAptType()) { - log.info(" AptTypeDTO {"); - log.info(" houseTy: {}", type.getHouseTy()); - log.info(" suplyAr: {}", type.getSuplyAr()); - log.info(" suplyHshldco: {}", type.getSuplyHshldco()); - log.info(" spsplyHshldco: {}", type.getSpsplyHshldco()); - log.info(" lttotTopAmount: {}", type.getLttotTopAmount()); - log.info(" }"); - } - log.info(" ]"); - log.info("}"); - } - - - -} diff --git a/src/test/java/org/scoula/service/HouseServiceTest.java b/src/test/java/org/scoula/service/HouseServiceTest.java deleted file mode 100644 index 9a9e859..0000000 --- a/src/test/java/org/scoula/service/HouseServiceTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.scoula.service; - -import lombok.extern.log4j.Log4j2; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.scoula.config.RootConfig; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit.jupiter.SpringExtension; - -import static org.junit.jupiter.api.Assertions.*; - -@ExtendWith(SpringExtension.class) -@ContextConfiguration(classes = { HouseService.class, RootConfig.class }) // AptService만 테스트 -@Log4j2 -class HouseServiceTest { - @Autowired - private HouseService houseService; - - - - -} \ No newline at end of file diff --git a/src/test/java/org/scoula/service/OfficetelServiceTest.java b/src/test/java/org/scoula/service/OfficetelServiceTest.java deleted file mode 100644 index ea2d8a0..0000000 --- a/src/test/java/org/scoula/service/OfficetelServiceTest.java +++ /dev/null @@ -1,119 +0,0 @@ -package org.scoula.service; - -import lombok.extern.log4j.Log4j2; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.scoula.config.RootConfig; -import org.scoula.dto.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit.jupiter.SpringExtension; - -import java.util.List; - -import static org.junit.jupiter.api.Assertions.*; - -@ExtendWith(SpringExtension.class) -@ContextConfiguration(classes = { OfficetelService.class, RootConfig.class }) // AptService만 테스트 -@Log4j2 -class OfficetelServiceTest { - - @Autowired - private OfficetelService officetelService; - - @Test - void fetchAptData() { - OfficetelResponseDTO response = officetelService - .fetchOfficetelData(1, 1); - log.info("전체 응답 {}",response); - - if (response != null && response.getData() != null) { - for (OfficetelDTO officetel : response.getData()) { - log.info("Apt: {} \n", officetel); - } - } - } - - @Test - void getAllOfficetelData() { - OfficetelResponseDTO response = officetelService.fetchOfficetelData(1,1); - Integer match_count = response.getMatchCount(); - log.info("Match!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!{} : ",match_count); - - response = officetelService.fetchOfficetelData(1,match_count); - if (response != null && response.getData() != null) { - for (OfficetelDTO officetel : response.getData()) { - log.info("Apt: {} \n", officetel); - } - } - } - - @Test - void saveOfficetelData() { - OfficetelResponseDTO response = officetelService.fetchOfficetelData(1,1); - Integer match_count = response.getMatchCount(); - log.info("Match!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!{}",match_count); - - if (match_count > 1) { - response = officetelService.fetchOfficetelData(1, match_count); - } - officetelService.saveOfficetelData(response); - if (response != null && response.getData() != null) { - for (OfficetelDTO officetel : response.getData()) { - log.info("저장된 APT: {}", officetel); - } - } else { - fail("response 또는 data가 null입니다."); - } - } - - @Test - void getOfficeTypeData() { - OfficetelTypeResponseDTO response = officetelService.fetchOfficetelTypeData("2025950037"); - log.info("전체 응답 {}",response); - - if (response != null && response.getData() != null) { - for (OfficetelTypeDTO apt : response.getData()) { - log.info("OfficetelType: {} \n", apt); - } - } - } - - - @Test - void getAllAptTypeData() { - OfficetelTypeResponseDTO response = officetelService.fetchOfficetelTypeData("2025950037"); - Integer match_count = response.getMatchCount(); - log.info("Current!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! : {}",match_count); - } - - @Test - void getallIdx() { - List response = officetelService.getOfficetelIdxAndHouseManageNo(); - response.forEach(dto -> log.info(dto.toString())); - } - - @Test - void saveOfficetelTypes (){ - officetelService.saveOfficetelTypes(); - } - - @Test - void syncOfficetelData() { - officetelService.syncOfficetelData(); - } - -// @Test -// void deleteOfficetelData() { -// officetelService.deleteOldOfficetelDataBeforeThisMonth(); -// } - -// @Test -// void getAptDetail() { -// OfficetelDetailDTO detail = officetelService.getOfficetelDetail("2025950040"); -// log.info("OfficetelDetailDTO : {}",detail.toString()); -// -// } - - -} \ No newline at end of file