diff --git a/src/main/resources/appConfig.xml b/src/main/resources/appConfig.xml new file mode 100644 index 0000000..22b6d69 --- /dev/null +++ b/src/main/resources/appConfig.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/java/hello/core/beanfind/ApplicationContextExtendsFindTest.java b/src/test/java/hello/core/beanfind/ApplicationContextExtendsFindTest.java index 0fffb48..acf639a 100644 --- a/src/test/java/hello/core/beanfind/ApplicationContextExtendsFindTest.java +++ b/src/test/java/hello/core/beanfind/ApplicationContextExtendsFindTest.java @@ -73,6 +73,4 @@ public DiscountPolicy fixDiscountPolicy() { return new FixDiscountPolicy(); } } - - } diff --git a/src/test/java/hello/core/xml/XmlAppContext.java b/src/test/java/hello/core/xml/XmlAppContext.java new file mode 100644 index 0000000..d0f6c6a --- /dev/null +++ b/src/test/java/hello/core/xml/XmlAppContext.java @@ -0,0 +1,19 @@ +package hello.core.xml; + +import hello.core.member.MemberService; +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.GenericXmlApplicationContext; + +import static org.assertj.core.api.Assertions.assertThat; + +public class XmlAppContext { + + @Test + void xmlAppContext() { + ApplicationContext ac = new GenericXmlApplicationContext("appConfig.xml"); + MemberService memberService = ac.getBean("memberService", MemberService.class); + assertThat(memberService).isInstanceOf(MemberService.class); + } +}