실패 테스트 모두 수정

This commit is contained in:
shinmj
2021-11-15 14:58:16 +09:00
parent 952c5e248e
commit e298bc9c20
22 changed files with 149 additions and 46 deletions

View File

@@ -2,8 +2,10 @@ package org.egovframe.cloud.userservice;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
@SpringBootTest
@ActiveProfiles(profiles = "test")
class UserServiceApplicationTests {
@Test

View File

@@ -2,16 +2,22 @@ package org.egovframe.cloud.userservice.config;
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.boot.test.web.client.TestRestTemplate;
import org.springframework.context.MessageSource;
import java.util.Locale;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.TestPropertySource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
@SpringBootTest(webEnvironment = RANDOM_PORT)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@EnableConfigurationProperties
@TestPropertySource(properties = {"spring.config.location=classpath:application-test.yml"})
@ActiveProfiles(profiles = "test")
class MessageSourceConfigTest {
@Autowired
@@ -20,7 +26,7 @@ class MessageSourceConfigTest {
@Test
public void 메세지를_외부위치에서_읽어온다() throws Exception {
// when
String message = restTemplate.getForObject("http://localhost:8000/user-service/api/v1/messages/common.login/ko", String.class);
String message = restTemplate.getForObject("/api/v1/messages/common.login/ko", String.class);
// then
assertThat(message).isEqualTo("로그인");