Skip to content

Commit

Permalink
Merge pull request #72 from INFP-Study/feature/forest-api
Browse files Browse the repository at this point in the history
[FEATURE] ForestApiProperties 제거
  • Loading branch information
choisungwook authored Oct 31, 2021
2 parents 4f42117 + 765a37f commit 124b298
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import com.infp.ciat.common.forest.dto.ForestRequestDto;
import com.infp.ciat.common.forest.model.ForestDetailIntro;
import com.infp.ciat.common.forest.model.ForestListSearch;
import com.infp.ciat.common.properties.ForestProperties;
import com.infp.ciat.common.util.CiatStringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Lazy;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.xml.bind.JAXBContext;
Expand All @@ -24,17 +23,15 @@
@Service
public class ForestApiService {

private final ForestProperties forestProperties;
@Value("${forest.key}")
private String forestKey;

public ForestApiService(ForestProperties forestProperties) {
this.forestProperties = forestProperties;
}
@Value("${forest.url}")
private String forestUrl;

public List<ForestListSearch.Item> forestSearchList(ForestRequestDto dto) {
List<ForestListSearch.Item> list = null;
String forestUrl = forestProperties.getUrl();
String forestKey = forestProperties.getKey();


try {

String url = forestUrl
Expand Down Expand Up @@ -75,8 +72,6 @@ public String getHtml(String url) throws IOException {
}

public ForestDetailIntro forestDetailIntro(String q1) {
String forestUrl = forestProperties.getUrl();
String forestKey = forestProperties.getKey();

ForestDetailIntro forest = null;
String url = forestUrl
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.infp.ciat;

import com.infp.ciat.common.properties.ForestProperties;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

@ActiveProfiles("test")
@SpringBootTest(classes = ForestProperties.class)
@SpringBootTest
class CiatApplicationTests {

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package com.infp.ciat.user.service;

import com.infp.ciat.common.properties.ForestProperties;
import com.infp.ciat.user.controller.dto.request.SignupRequestDTO;
import com.infp.ciat.user.entity.Account;
import com.infp.ciat.user.repository.AccountRepository;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.test.context.ActiveProfiles;
Expand All @@ -18,14 +17,10 @@
import static org.assertj.core.api.Assertions.assertThat;

@ActiveProfiles("test")
@EnableConfigurationProperties(ForestProperties.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = ForestProperties.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Transactional
class AccountServiceTest {

@Autowired
private ForestProperties forestProperties;

@Autowired
AccountService accountService;

Expand All @@ -35,6 +30,11 @@ class AccountServiceTest {
@Autowired
PasswordEncoder passwordEncoder;

@BeforeAll
public static void before() {
System.setProperty("jasypt.encryptor.password", "xiQ7bRtKmkaA1vY826Av21yV");
}

@AfterEach
public void aftereach() {
try {
Expand Down

0 comments on commit 124b298

Please sign in to comment.